BUG-612 : switched ERO to ByteBuf.
[bgpcep.git] / pcep / impl / src / main / java / org / opendaylight / protocol / pcep / impl / object / PCEPPathKeyObjectParser.java
index 6c753f10a403b6206a1a21714a2d3e854d7e36bd..57e85947bb997370a98b8cae495fcb2742649b14 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.explicit.route.object.ero.Subobject;
@@ -48,8 +47,7 @@ public class PCEPPathKeyObjectParser extends AbstractEROWithSubobjectsParser {
                builder.setIgnore(header.isIgnore());
                builder.setProcessingRule(header.isProcessingRule());
                final List<PathKeys> pk = new ArrayList<>();
-               //FIXME: switch to ByteBuf
-               final List<Subobject> subs = parseSubobjects(ByteArray.readAllBytes(bytes));
+               final List<Subobject> subs = parseSubobjects(bytes);
                for (final Subobject s : subs) {
                        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCase k = (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCase) s.getSubobjectType();
                        pk.add(new PathKeysBuilder().setLoose(s.isLoose()).setPceId(k.getPathKey().getPceId()).setPathKey(k.getPathKey().getPathKey()).build());