BUG-612 : switched Labels to ByteBuf.
[bgpcep.git] / pcep / impl / src / main / java / org / opendaylight / protocol / pcep / impl / subobject / EROLabelSubobjectParser.java
index a817874bf220fa7c0dbb0dba48b2af6a5e2ad37a..274492fda833d7ec57a25b9eb11de92be7ad55cf 100644 (file)
@@ -60,8 +60,7 @@ public class EROLabelSubobjectParser implements EROSubobjectParser, EROSubobject
                final BitSet reserved = ByteArray.bytesToBitSet(ByteArray.readBytes(buffer, RES_F_LENGTH));
                final short cType = (short) UnsignedBytes.toInt(buffer.readByte());
 
-               //FIXME: switch to ByteBuf
-               final LabelType labelType = this.registry.parseLabel(cType, ByteArray.readAllBytes(buffer));
+               final LabelType labelType = this.registry.parseLabel(cType, buffer.slice());
                if (labelType == null) {
                        throw new PCEPDeserializerException("Unknown C-TYPE for ero label subobject. Passed: " + cType);
                }