Migrate uint/ByteBuf interactions
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / java / org / opendaylight / openflowjava / nx / codec / match / NshMdtypeCodec.java
index 2471846e1871a09d24e7df09ce387e2e68c43961..1d0594deb96bb2738830859e656b578b261988b6 100644 (file)
@@ -5,9 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.nx.codec.match;
 
+import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint8;
+
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.nx.api.NiciraConstants;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
@@ -47,9 +48,9 @@ public class NshMdtypeCodec extends AbstractExperimenterMatchCodec {
 
     @Override
     protected NxExpMatchEntryValue deserializeValue(ByteBuf message, boolean hasMask) {
-        Short value = message.readUnsignedByte();
-        NshMdtypeValues nshMdtypeValues = new NshMdtypeValuesBuilder().setValue(value).build();
-        return new NshMdtypeCaseValueBuilder().setNshMdtypeValues(nshMdtypeValues).build();
+        return new NshMdtypeCaseValueBuilder()
+                .setNshMdtypeValues(new NshMdtypeValuesBuilder().setValue(readUint8(message)).build())
+                .build();
     }
 
     @Override