lib/XjsStream.js
function emitBuffer() {
  if (!this._buffer) {
    return;
  }
  for (var i = this._marker; i < this._buffer.length; i++) {
    var data = this._buffer[i];
    if (data.writable === true) {
      break;
    } else if (data.writable === false) {
      emitBuffer.call(data);
    } else {
      this.emit('data', data, 'utf8');
    }
  }
  if (i === this._buffer.length) {
    delete this._buffer;
    delete this._marker;
    if (!this.writable) {
      this.emit('end');
    }
  } else {
    this._marker = i;
  }
}
function emitBuffer() {
  if (!this._buffer) {
    return;
  }
  for (var i = this._marker; i < this._buffer.length; i++) {
    var data = this._buffer[i];
    if (data.writable === true) {
      break;
    } else if (data.writable === false) {
      emitBuffer.call(data);
    } else {
      this.emit('data', data, 'utf8');
    }
  }
  if (i === this._buffer.length) {
    delete this._buffer;
    delete this._marker;
    if (!this.writable) {
      this.emit('end');
    }
  } else {
    this._marker = i;
  }
}
function emitBuffer ( ) { if ( ! this . _buffer ) { return ; } for ( var i = this . _marker ; i < this . _buffer . length ; i ++ ) { var data = this . _buffer [ i ] ; if ( data . writable === true ) { break ; } else if ( data . writable === false ) { emitBuffer . call ( data ) ; } else { this . emit ( 'data' , data , 'utf8' ) ; } } if ( i === this . _buffer . length ) { delete this . _buffer ; delete this . _marker ; if ( ! this . writable ) { this . emit ( 'end' ) ; } } else { this . _marker = i ; } }
When not waiting on an async substream, emit right away. Otherwise start._buffering.
When not waiting on an async substream emit right away . Otherwise start . _buffering .