async _fill() {
    // Slide existing data to beginning.
    if (this.r > 0) {
      this.buf.copyWithin(0, this.r, this.w);
      this.w -= this.r;
      this.r = 0;
    }
    if (this.w >= this.buf.byteLength) {
      throw Error("bufio: tried to fill full buffer");
    }
    // Read new data: try a limited number of times.
    for (let i = MAX_CONSECUTIVE_EMPTY_READS; i > 0; i--) {
      const rr = await this.rd.read(this.buf.subarray(this.w));
      if (rr === null) {
        this.eof = true;
        return;
      }
      assert(rr >= 0, "negative read");
      this.w += rr;
      if (rr > 0) {
        return;
      }
    }
    throw new Error(
      `No progress after ${MAX_CONSECUTIVE_EMPTY_READS} read() calls`,
    );
  }
// Reads a new chunk into the buffer.
Reads a new chunk into the buffer.
Reads a new chunk into the buffer .
async _fill() {
    if (this.r > 0) {
      this.buf.copyWithin(0, this.r, this.w);
      this.w -= this.r;
      this.r = 0;
    }
    if (this.w >= this.buf.byteLength) {
      throw Error("bufio: tried to fill full buffer");
    }
    for (let i = MAX_CONSECUTIVE_EMPTY_READS; i > 0; i--) {
      const rr = await this.rd.read(this.buf.subarray(this.w));
      if (rr === null) {
        this.eof = true;
        return;
      }
      assert(rr >= 0, "negative read");
      this.w += rr;
      if (rr > 0) {
        return;
      }
    }
    throw new Error(
      `No progress after ${MAX_CONSECUTIVE_EMPTY_READS} read() calls`,
    );
  }
async _fill ( ) { if ( this . r > 0 ) { this . buf . copyWithin ( 0 , this . r , this . w ) ; this . w -= this . r ; this . r = 0 ; } if ( this . w >= this . buf . byteLength ) { throw Error ( "bufio: tried to fill full buffer" ) ; } for ( let i = MAX_CONSECUTIVE_EMPTY_READS ; i > 0 ; i -- ) { const rr = await this . rd . read ( this . buf . subarray ( this . w ) ) ; if ( rr === null ) { this . eof = true ; return ; } assert ( rr >= 0 , "negative read" ) ; this . w += rr ; if ( rr > 0 ) { return ; } } throw new Error ( ` ${ MAX_CONSECUTIVE_EMPTY_READS } ` , ) ; }
Reads a new chunk into the buffer.
Reads a new chunk into the buffer .
// Slide existing data to beginning. // Read new data: try a limited number of times.