Change-Id: Id25e4baab39ba13ad71748f4835732357fc11104
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
public static Ipv4Prefix prefixForByteBuf(final ByteBuf bytes) {
final int prefixLength = bytes.readByte();
final int size = prefixLength / Byte.SIZE + ((prefixLength % Byte.SIZE == 0) ? 0 : 1);
- Preconditions.checkArgument(size <= bytes.readableBytes(), "Illegal length of IP prefix: " + (bytes.readableBytes()));
+ Preconditions.checkArgument(size <= bytes.readableBytes(), "Illegal length of IP prefix: %s", bytes.readableBytes());
return Ipv4Util.prefixForBytes(ByteArray.readBytes(bytes, size), prefixLength);
}
public static Ipv6Prefix prefixForByteBuf(final ByteBuf bytes) {
final int prefixLength = bytes.readByte();
final int size = prefixLength / Byte.SIZE + ((prefixLength % Byte.SIZE == 0) ? 0 : 1);
- Preconditions.checkArgument(size <= bytes.readableBytes(), "Illegal length of IP prefix: " + (bytes.readableBytes()));
+ Preconditions.checkArgument(size <= bytes.readableBytes(), "Illegal length of IP prefix: %s", bytes.readableBytes());
return Ipv6Util.prefixForBytes(ByteArray.readBytes(bytes, size), prefixLength);
}