Getting rid of readerIndex handling.
[bgpcep.git] / pcep / impl / src / main / java / org / opendaylight / protocol / pcep / impl / object / PCEPNotificationObjectParser.java
index d4b7dbc1fc8d8f66ac18ffb008643cce9da03014..bf095a438e83a1e338e755f5871a32b66409892c 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.protocol.pcep.impl.object;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedByte;
 
 import com.google.common.base.Preconditions;
-import com.google.common.primitives.UnsignedBytes;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
@@ -53,9 +52,9 @@ public class PCEPNotificationObjectParser extends AbstractObjectWithTlvsParser<C
         final CNotificationBuilder builder = new CNotificationBuilder();
         builder.setIgnore(header.isIgnore());
         builder.setProcessingRule(header.isProcessingRule());
-        bytes.readerIndex(bytes.readerIndex() + NT_F_OFFSET);
-        builder.setType((short) UnsignedBytes.toInt(bytes.readByte()));
-        builder.setValue((short) UnsignedBytes.toInt(bytes.readByte()));
+        bytes.skipBytes(NT_F_OFFSET);
+        builder.setType(bytes.readUnsignedByte());
+        builder.setValue(bytes.readUnsignedByte());
         parseTlvs(builder, bytes.slice());
         return builder.build();
     }