Search in sources :

Example 1 with HexString

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.HexString in project bgpcep by opendaylight.

the class OpaqueUtil method buildExtended.

private static void buildExtended(final OpaqueValueBuilder builder, final ByteBuf buffer) {
    final int extendedType = buffer.readUnsignedShort();
    final HexString opaqueValue = buildOpaqueValue(buffer);
    builder.setOpaqueExtendedType(extendedType).setOpaque(opaqueValue);
}
Also used : HexString(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.HexString)

Example 2 with HexString

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.HexString in project bgpcep by opendaylight.

the class OpaqueUtil method buildOpaqueValue.

private static HexString buildOpaqueValue(final ByteBuf buffer) {
    final int length = buffer.readUnsignedShort();
    final byte[] value = ByteArray.readBytes(buffer, length);
    final String hexDump = ByteBufUtil.hexDump(value);
    final Iterable<String> splitted = Splitter.fixedLength(2).split(hexDump);
    return new HexString(Joiner.on(SEPARATOR).join(splitted));
}
Also used : HexString(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.HexString) HexString(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.HexString)

Aggregations

HexString (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.HexString)2