package org.opendaylight.protocol.bgp.parser.impl.message.update;
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.ArrayList;
}
protected void parseHeader(final ExtendedCommunitiesBuilder exBuilder, final ByteBuf buffer) {
- exBuilder.setCommType((short) UnsignedBytes.toInt(buffer.readByte()));
- exBuilder.setCommSubType((short) UnsignedBytes.toInt(buffer.readByte()));
+ exBuilder.setCommType(buffer.readUnsignedByte());
+ exBuilder.setCommSubType(buffer.readUnsignedByte());
}
/**
* Parse Extended Community according to their type.
*
- * @param bytes byte array to be parsed
+ * @param refCache
+ * @param comm ExtendedCommunitiesBuilder based on which community type will be new ExtendedCommunity created
+ * @param buffer byte array to be parsed
* @return new Specific Extended Community
* @throws BGPDocumentedException if the type is not recognized
*/