This closes #2227
This commit is contained in:
commit
70f5512622
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue