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.subelem.EncryptionSubElement.java

License:Open Source License

@Override
public int encode(ByteBuf buf) {

    int start = buf.writerIndex();
    //encode Resvd
    //encode WBID
    wbid = (byte) (wbid & 0b00011111);
    buf.writeByte(wbid);/*from  w  w  w.  j  a  v a2s .c  o m*/
    //encodeEncryptionCapabilites
    buf.writeBytes(ByteManager.unsignedShortToArray(this.encryptioCapability));
    return buf.writerIndex() - start;
}

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

License:Open Source License

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

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

License:Open Source License

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

    buf.writeBytes(this.address);
    return (buf.writerIndex() - start);
}

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

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();
    buf.writeByte(ByteManager.shortToUnsingedByte(this.length));
    buf.writeBytes(this.address);

    return buf.writerIndex() - start;
}

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

License:Open Source License

public int encode(ByteBuf buf) {
    int start = buf.writerIndex();
    buf.writeByte(ByteManager.shortToUnsingedByte(this.length));
    buf.writeBytes(this.data);

    return buf.writerIndex() - start;
}

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

License:Open Source License

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

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

License:Open Source License

@Override
public int encode(ByteBuf buf) {

    int start = buf.writerIndex();
    buf.writeBytes(ByteManager.unsignedIntToArray(this.getVendorId()));
    //encode Encryption Sub-Element
    for (BoardDataSubElem element : this.boardDataList) {
        element.encode(buf);//  ww w.  jav a 2s.  c o  m
    }

    return buf.writerIndex() - start;
}

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

License:Open Source License

@Override
public int encode(ByteBuf buf) {
    int start = buf.writerIndex();
    //encode Max Radios
    buf.writeByte(ByteManager.shortToUnsingedByte(this.maxRadios));

    //encode radiosInUse
    buf.writeByte(ByteManager.shortToUnsingedByte(this.radioInUse));

    //encode numEncrypt
    buf.writeByte(ByteManager.shortToUnsingedByte(this.numEncrypt));

    //encode Encryption Sub-Element
    for (EncryptionSubElement element : this.encysubElemList) {
        element.encode(buf);/*from  w  w w  .  j a v  a2 s.c  o m*/
    }

    //encode Descriptor Sub-Element
    for (DescriptorSubElement element : this.descSubElemList) {
        element.encode(buf);
    }

    return buf.writerIndex() - start;
}

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

License:Open Source License

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

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

License:Open Source License

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