Fix inverted array read check

This commit is contained in:
KennyTV 2019-11-26 13:51:37 +01:00
parent 1b207251e8
commit 915258169e

View File

@ -18,7 +18,7 @@ public class ByteArrayType extends Type<byte[]> {
@Override
public byte[] read(ByteBuf buffer) throws Exception {
int length = Type.VAR_INT.read(buffer);
Preconditions.checkArgument(!buffer.isReadable(length), "Length is fewer than readable bytes");
Preconditions.checkArgument(buffer.isReadable(length), "Length is fewer than readable bytes");
byte[] array = new byte[length];
buffer.readBytes(array);
return array;