length property

int get length

Returns buffer length (bytes) or a default value.

Implementation

int get length => _length;
set length (int length)

Set the buffer length (bytes).

A StateError is raised if the buffer has already been created

Implementation

set length(int length) {
  if (isBufferSet()) {
    throw StateError('illegal attempt to change length of existing buffer');
  }
  _length = length;
}