truncate(n) {
    if (n === 0) {
      this.reset();
      return;
    }
    if (n < 0 || n > this.length) {
      throw Error("bytes.Buffer: truncation out of range");
    }
    this.#reslice(this.#off + n);
  }
/** Discards all but the first `n` unread bytes from the buffer but
   * continues to use the same allocated storage. It throws if `n` is
   * negative or greater than the length of the buffer. */
Discards all but the first `n` unread bytes from the buffer but
continues to use the same allocated storage. It throws if `n` is
negative or greater than the length of the buffer.
Discards all but the first ` n ` unread bytes from the buffer but continues to use the same allocated storage . It throws if ` n ` is negative or greater than the length of the buffer .
truncate(n) {
    if (n === 0) {
      this.reset();
      return;
    }
    if (n < 0 || n > this.length) {
      throw Error("bytes.Buffer: truncation out of range");
    }
    this.#reslice(this.#off + n);
  }
truncate ( n ) { if ( n === 0 ) { this . reset ( ) ; return ; } if ( n < 0 || n > this . length ) { throw Error ( "bytes.Buffer: truncation out of range" ) ; } this . #reslice ( this . #off + n ) ; }
Discards all but the first `n` unread bytes from the buffer but
 continues to use the same allocated storage.
Discards all but the first ` n ` unread bytes from the buffer but continues to use the same allocated storage .