Migrate uint/ByteBuf interactions
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / PortModInputMessageFactory.java
index 45b69ef0e2d5cdf64ea5802b855eb4dd604edeb9..9b1dfa0e43d354831bbeaa8cccc3cbfa9a26edf2 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
 
+import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint32;
+
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -32,8 +34,8 @@ public class PortModInputMessageFactory implements OFDeserializer<PortModInput>
     public PortModInput deserialize(final ByteBuf rawMessage) {
         PortModInputBuilder builder = new PortModInputBuilder();
         builder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
-        builder.setXid(rawMessage.readUnsignedInt());
-        builder.setPortNo(new PortNumber(rawMessage.readUnsignedInt()));
+        builder.setXid(readUint32(rawMessage));
+        builder.setPortNo(new PortNumber(readUint32(rawMessage)));
         rawMessage.skipBytes(PADDING_IN_PORT_MOD_MESSAGE_1);
         builder.setHwAddress(ByteBufUtils.readIetfMacAddress(rawMessage));
         rawMessage.skipBytes(PADDING_IN_PORT_MOD_MESSAGE_2);