lib/common/streams/filereadstream.js
function FileReadStream(path, options) {
  stream.Stream.call(this);
  this.readable = true;

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

  this._destroyed = false;
  this._streamEnded = false;
  this._fd = null;
  this._fileName = undefined;
  this._highWaterMark = options.highWaterMark || bufferSize;
  this._offset = 0;
  this._paused = undefined;
  this._allocator = options.allocator;
  this._fileName = path;

  this._md5hash = null;
  this._md5sum = undefined;

  if (options.calcContentMd5) {
    this._md5hash = new Md5Wrapper().createMd5Hash();
  }

  this._open();
}
function FileReadStream(path, options) {
  stream.Stream.call(this);
  this.readable = true;

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

  this._destroyed = false;
  this._streamEnded = false;
  this._fd = null;
  this._fileName = undefined;
  this._highWaterMark = options.highWaterMark || bufferSize;
  this._offset = 0;
  this._paused = undefined;
  this._allocator = options.allocator;
  this._fileName = path;

  this._md5hash = null;
  this._md5sum = undefined;

  if (options.calcContentMd5) {
    this._md5hash = new Md5Wrapper().createMd5Hash();
  }

  this._open();
}
function FileReadStream ( path , options ) { stream . Stream . call ( this ) ; this . readable = true ; if ( ! options ) { options = { } ; } this . _destroyed = false ; this . _streamEnded = false ; this . _fd = null ; this . _fileName = undefined ; this . _highWaterMark = options . highWaterMark || bufferSize ; this . _offset = 0 ; this . _paused = undefined ; this . _allocator = options . allocator ; this . _fileName = path ; this . _md5hash = null ; this . _md5sum = undefined ; if ( options . calcContentMd5 ) { this . _md5hash = new Md5Wrapper ( ) . createMd5Hash ( ) ; } this . _open ( ) ; }
File read stream
1. Calculate md5
2. Track reading offset
3. Work with customize memory allocator
4. Buffer data from stream.
@param {object} options stream.Readable options
File read stream 1 . Calculate md5 2 . Track reading offset 3 . Work with customize memory allocator 4 . Buffer data from stream .