getString method
Reads a region of the buffer as an encoded string.
Items are read from the range [offset : offset+length]. If length is omitted, the range
extends to the end of the buffer.
The range must satisy the relations 0 ≤ offset ≤ offset+length ≤ this.length.
Implementation
String getString(final int length, [final BufferEncoding encoding = BufferEncoding.utf8]) {
final String value = buffer.getString(encoding, offset, length);
offset += length;
return value;
}