readSync(p) {
    if (this.empty()) {
      // Buffer is empty, reset to recover space.
      this.reset();
      if (p.byteLength === 0) {
        // this edge case is tested in 'bufferReadEmptyAtEOF' test
        return 0;
      }
      return null;
    }
    const nread = copy(this.#buf.subarray(this.#off), p);
    this.#off += nread;
    return nread;
  }
/** Reads the next `p.length` bytes from the buffer or until the buffer is
   * drained. Returns the number of bytes read. If the buffer has no data to
   * return, the return is EOF (`null`). */
Reads the next `p.length` bytes from the buffer or until the buffer is
drained. Returns the number of bytes read. If the buffer has no data to
return, the return is EOF (`null`).
Reads the next ` p . length ` bytes from the buffer or until the buffer is drained . Returns the number of bytes read . If the buffer has no data to return the return is EOF ( ` null ` ) .
readSync(p) {
    if (this.empty()) {
      this.reset();
      if (p.byteLength === 0) {
        return 0;
      }
      return null;
    }
    const nread = copy(this.#buf.subarray(this.#off), p);
    this.#off += nread;
    return nread;
  }
readSync ( p ) { if ( this . empty ( ) ) { this . reset ( ) ; if ( p . byteLength === 0 ) { return 0 ; } return null ; } const nread = copy ( this . #buf . subarray ( this . #off ) , p ) ; this . #off += nread ; return nread ; }
Reads the next `p.length` bytes from the buffer or until the buffer is
 drained.
Reads the next ` p . length ` bytes from the buffer or until the buffer is drained .
// Buffer is empty, reset to recover space. // this edge case is tested in 'bufferReadEmptyAtEOF' test