lib/input.js
function _write (chunk, encoding, callback) {
  /* istanbul ignore else */
  if (Array.isArray(this.options.input.buffer)) {
    /* istanbul ignore else */
    if (is.buffer(chunk)) {
      if (this.options.input.buffer.length === 0) {
        const that = this;
        this.on('finish', function () {
          that.streamInFinished = true;
        });
      }
      this.options.input.buffer.push(chunk);
      callback();
    } else {
      callback(new Error('Non-Buffer data on Writable Stream'));
    }
  } else {
    callback(new Error('Unexpected data on Writable Stream'));
  }
}
function _write (chunk, encoding, callback) {
  /* istanbul ignore else */
  if (Array.isArray(this.options.input.buffer)) {
    /* istanbul ignore else */
    if (is.buffer(chunk)) {
      if (this.options.input.buffer.length === 0) {
        const that = this;
        this.on('finish', function () {
          that.streamInFinished = true;
        });
      }
      this.options.input.buffer.push(chunk);
      callback();
    } else {
      callback(new Error('Non-Buffer data on Writable Stream'));
    }
  } else {
    callback(new Error('Unexpected data on Writable Stream'));
  }
}
function _write ( chunk , encoding , callback ) { /* istanbul ignore else */ if ( Array . isArray ( this . options . input . buffer ) ) { /* istanbul ignore else */ if ( is . buffer ( chunk ) ) { if ( this . options . input . buffer . length === 0 ) { const that = this ; this . on ( 'finish' , function ( ) { that . streamInFinished = true ; } ) ; } this . options . input . buffer . push ( chunk ) ; callback ( ) ; } else { callback ( new Error ( 'Non-Buffer data on Writable Stream' ) ) ; } } else { callback ( new Error ( 'Unexpected data on Writable Stream' ) ) ; } }
Handle incoming Buffer chunk on Writable Stream.
@private
@param {Buffer} chunk
@param {String} encoding - unused
@param {Function} callback
Handle incoming Buffer chunk on Writable Stream .