Add ByteBufUtils
[bgpcep.git] / bgp / parser-impl / src / main / java / org / opendaylight / protocol / bgp / parser / impl / message / update / extended / communities / four / octect / as / specific / SourceAS4OctectHandler.java
index a6ff8343c2b825a91b73dec844ff81f81565006b..5dea91f7a934a87b0fa221c6afa8781ae236d3aa 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.commun
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.Abstract4OctetAsExtendedCommunity;
+import org.opendaylight.protocol.util.ByteBufUtils;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
@@ -26,7 +27,7 @@ public final class SourceAS4OctectHandler extends Abstract4OctetAsExtendedCommun
     @Override
     public ExtendedCommunity parseExtendedCommunity(final ByteBuf body) {
         final SourceAs4ExtendedCommunityBuilder builder = new SourceAs4ExtendedCommunityBuilder();
-        builder.setGlobalAdministrator(new AsNumber(body.readUnsignedInt()));
+        builder.setGlobalAdministrator(new AsNumber(ByteBufUtils.readUint32(body)));
         body.skipBytes(LOCAL_LENGTH);
         return new SourceAs4ExtendedCommunityCaseBuilder().setSourceAs4ExtendedCommunity(
                 builder.build()).build();