ARTEMIS-1482 Add back check for SimpleString
This commit is contained in:
parent
3d2eadfb8a
commit
985d1e1fcb
|
@ -179,6 +179,9 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SimpleString readSimpleString(final ByteBuf buffer, final int length) {
|
public static SimpleString readSimpleString(final ByteBuf buffer, final int length) {
|
||||||
|
if (length > buffer.readableBytes()) {
|
||||||
|
throw new IndexOutOfBoundsException();
|
||||||
|
}
|
||||||
byte[] data = new byte[length];
|
byte[] data = new byte[length];
|
||||||
buffer.readBytes(data);
|
buffer.readBytes(data);
|
||||||
return new SimpleString(data);
|
return new SimpleString(data);
|
||||||
|
|
Loading…
Reference in New Issue