reader.js
function BufferStreamReader (data, options) {
  if (!(this instanceof BufferStreamReader)) {
    return new BufferStreamReader(data);
  }

  if (!options) {
    options = {};
  }

  stream.Readable.call(this, options);

  this._data = null;
  this._chunkSize = options.chunkSize || -1;

  if (typeof data === 'string') {
    this._data = new Buffer(data, options.encoding || 'utf8');
  } else if (Buffer.isBuffer(data)) {
    this._data = data;
  }
}
function BufferStreamReader (data, options) {
  if (!(this instanceof BufferStreamReader)) {
    return new BufferStreamReader(data);
  }

  if (!options) {
    options = {};
  }

  stream.Readable.call(this, options);

  this._data = null;
  this._chunkSize = options.chunkSize || -1;

  if (typeof data === 'string') {
    this._data = new Buffer(data, options.encoding || 'utf8');
  } else if (Buffer.isBuffer(data)) {
    this._data = data;
  }
}
function BufferStreamReader ( data , options ) { if ( ! ( this instanceof BufferStreamReader ) ) { return new BufferStreamReader ( data ) ; } if ( ! options ) { options = { } ; } stream . Readable . call ( this , options ) ; this . _data = null ; this . _chunkSize = options . chunkSize || - 1 ; if ( typeof data === 'string' ) { this . _data = new Buffer ( data , options . encoding || 'utf8' ) ; } else if ( Buffer . isBuffer ( data ) ) { this . _data = data ; } }
Create a new stream reader

@param data
@param options
@returns {StringReader}

@constructor
Create a new stream reader