setLength method
Sets the length
of this buffer. Increases internal bytes buffer capacity if needed.
Implementation
@override
void setLength(int length) {
if (length < 0) {
length = 0;
} else if (length > _bytes.length) {
ensureCapacity(length);
}
_length = length;
if (_position > _length) {
_position = _length;
}
}