BUG-612 : switched ERO to ByteBuf.
[bgpcep.git] / pcep / impl / src / main / java / org / opendaylight / protocol / pcep / impl / object / PCEPIncludeRouteObjectParser.java
index 67c0079b216876ec1861464ea1ddc382859df587..0196394ee2e4f2416169b0927b58d0e237df4967 100644 (file)
@@ -15,7 +15,6 @@ import java.util.List;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
-import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.Iro;
@@ -46,8 +45,7 @@ public class PCEPIncludeRouteObjectParser extends AbstractEROWithSubobjectsParse
                builder.setIgnore(header.isIgnore());
                builder.setProcessingRule(header.isProcessingRule());
                final List<Subobject> subs = new ArrayList<>();
-               //FIXME: switch to ByteBuf
-               for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject s : parseSubobjects(ByteArray.readAllBytes(bytes))) {
+               for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject s : parseSubobjects(bytes)) {
                        subs.add(new SubobjectBuilder().setSubobjectType(s.getSubobjectType()).build());
                }
                builder.setSubobject(subs);