async peek(n) {
    if (n < 0) {
      throw Error("negative count");
    }
    let avail = this.w - this.r;
    while (avail < n && avail < this.buf.byteLength && !this.eof) {
      try {
        await this._fill();
      } catch (err) {
        err.partial = this.buf.subarray(this.r, this.w);
        throw err;
      }
      avail = this.w - this.r;
    }
    if (avail === 0 && this.eof) {
      return null;
    } else if (avail < n && this.eof) {
      return this.buf.subarray(this.r, this.r + avail);
    } else if (avail < n) {
      throw new BufferFullError(this.buf.subarray(this.r, this.w));
    }
    return this.buf.subarray(this.r, this.r + n);
  }
/** `peek()` returns the next `n` bytes without advancing the reader. The
   * bytes stop being valid at the next read call.
   *
   * When the end of the underlying stream is reached, but there are unread
   * bytes left in the buffer, those bytes are returned. If there are no bytes
   * left in the buffer, it returns `null`.
   *
   * If an error is encountered before `n` bytes are available, `peek()` throws
   * an error with the `partial` property set to a slice of the buffer that
   * contains the bytes that were available before the error occurred.
   */
`peek()` returns the next `n` bytes without advancing the reader. The
bytes stop being valid at the next read call.

When the end of the underlying stream is reached, but there are unread
bytes left in the buffer, those bytes are returned. If there are no bytes
left in the buffer, it returns `null`.


` peek () ` returns the next ` n ` bytes without advancing the reader . The bytes stop being valid at the next read call . When the end of the underlying stream is reached but there are unread bytes left in the buffer those bytes are returned . If there are no bytes left in the buffer it returns ` null ` .
async peek(n) {
    if (n < 0) {
      throw Error("negative count");
    }
    let avail = this.w - this.r;
    while (avail < n && avail < this.buf.byteLength && !this.eof) {
      try {
        await this._fill();
      } catch (err) {
        err.partial = this.buf.subarray(this.r, this.w);
        throw err;
      }
      avail = this.w - this.r;
    }
    if (avail === 0 && this.eof) {
      return null;
    } else if (avail < n && this.eof) {
      return this.buf.subarray(this.r, this.r + avail);
    } else if (avail < n) {
      throw new BufferFullError(this.buf.subarray(this.r, this.w));
    }
    return this.buf.subarray(this.r, this.r + n);
  }
async peek ( n ) { if ( n < 0 ) { throw Error ( "negative count" ) ; } let avail = this . w - this . r ; while ( avail < n && avail < this . buf . byteLength && ! this . eof ) { try { await this . _fill ( ) ; } catch ( err ) { err . partial = this . buf . subarray ( this . r , this . w ) ; throw err ; } avail = this . w - this . r ; } if ( avail === 0 && this . eof ) { return null ; } else if ( avail < n && this . eof ) { return this . buf . subarray ( this . r , this . r + avail ) ; } else if ( avail < n ) { throw new BufferFullError ( this . buf . subarray ( this . r , this . w ) ) ; } return this . buf . subarray ( this . r , this . r + n ) ; }
`peek()` returns the next `n` bytes without advancing the reader.
` peek () ` returns the next ` n ` bytes without advancing the reader .