setLength method

void setLength(
  1. int length
)

Implementation

void setLength(int length) {
  if (length > this.length) {
    writeAll(List.filled(length - this.length, '\x00'));
  } else {
    delete(length, this.length);
  }
}