This commit is contained in:
Clebert Suconic 2018-08-08 14:23:54 -04:00
commit 70f5512622
1 changed files with 3 additions and 0 deletions

View File

@ -179,6 +179,9 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
}
public static SimpleString readSimpleString(final ByteBuf buffer, final int length) {
if (length > buffer.readableBytes()) {
throw new IndexOutOfBoundsException();
}
byte[] data = new byte[length];
buffer.readBytes(data);
return new SimpleString(data);