Example usage for io.netty.buffer ByteBuf writerIndex

List of usage examples for io.netty.buffer ByteBuf writerIndex

Introduction

In this page you can find the example usage for io.netty.buffer ByteBuf writerIndex.

Prototype

public abstract int writerIndex();

Source Link

Document

Returns the writerIndex of this buffer.

Usage

From source file:org.opendaylight.capwap.msgelements.MaxMsgLength.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();
    buf.writeBytes(ByteManager.unsignedShortToArray(this.maxLength));
    return buf.writerIndex() - start;
}

From source file:org.opendaylight.capwap.msgelements.RadioAdministrativeState.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();
    buf.writeByte(ByteManager.shortToUnsingedByte(this.radioId));
    buf.writeByte(ByteManager.shortToUnsingedByte(this.adminState));
    return buf.writerIndex() - start;
}

From source file:org.opendaylight.capwap.msgelements.RadioOperationalState.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();
    buf.writeByte(ByteManager.shortToUnsingedByte(this.radioId));
    buf.writeByte(ByteManager.shortToUnsingedByte(this.state));
    buf.writeByte(ByteManager.shortToUnsingedByte(this.cause));
    return buf.writerIndex() - start;
}

From source file:org.opendaylight.capwap.msgelements.ResultCode.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();
    buf.writeBytes(ByteManager.unsignedIntToArray(this.resultCode));
    return buf.writerIndex() - start;
}

From source file:org.opendaylight.capwap.msgelements.ReturnedMessageElement.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();

    buf.writeByte(ByteManager.shortToUnsingedByte(this.reason));
    buf.writeByte(ByteManager.shortToUnsingedByte(this.length));
    buf.writeBytes(this.msgElement);

    return buf.writerIndex() - start;
}

From source file:org.opendaylight.capwap.msgelements.SessionID.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();
    buf.writeBytes(this.sessionid);
    return buf.writerIndex() - start;
}

From source file:org.opendaylight.capwap.msgelements.StatisticsTimer.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();
    buf.writeBytes(ByteManager.unsignedShortToArray(this.getTimer()));
    return buf.writerIndex() - start;
}

From source file:org.opendaylight.capwap.msgelements.subelem.ACInformationSubElement.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();
    //Vendor info
    buf.writeBytes(ByteManager.unsignedIntToArray(this.acInfoVendorId));
    //InfoType/*from   w w  w.ja  v a 2  s .c  o  m*/
    buf.writeBytes(ByteManager.unsignedShortToArray(this.acInfoType));
    //AcLength
    buf.writeBytes(ByteManager.unsignedShortToArray(this.acInfoLength));
    //Ac info data
    buf.writeBytes(this.acInfoData);
    return buf.writerIndex() - start;
}

From source file:org.opendaylight.capwap.msgelements.subelem.BoardDataSubElem.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();

    //encode type
    buf.writeBytes(ByteManager.unsignedShortToArray(this.boardDataType));
    //encode board data lenght . Received in constructor
    buf.writeBytes(ByteManager.unsignedShortToArray(this.boardDataLength));
    //encode data
    buf.writeBytes(this.data);

    return buf.writerIndex() - start;
}

From source file:org.opendaylight.capwap.msgelements.subelem.DescriptorSubElement.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {

    int start = buf.writerIndex();

    //encode VendorID
    buf.writeBytes(ByteManager.unsignedIntToArray(this.vendorId));
    //encode Desctype
    buf.writeBytes(ByteManager.unsignedShortToArray(this.descType));
    //encode DescLength
    buf.writeBytes(ByteManager.unsignedShortToArray(this.descLength));
    //encode DescData
    buf.writeBytes(this.descData);

    return buf.writerIndex() - start;
}