lib/gridfile.js
function MongolianGridFileReadStream(file) {
    if (!file._id) throw new Error("Can only read files retrieved from the database")
    if (file.chunkSize instanceof Long) throw new Error("Long (64bit) chunkSize unsupported")
    if (file.chunkSize <= 0) throw new Error("File has invalid chunkSize: "+file.chunkSize)

    stream.Stream.call(this)

    this.file = file
    this.readable = true
    this._chunkCount = file.chunkCount()
    this._chunkIndex = 0

    process.nextTick(this._nextChunk.bind(this))
}
function MongolianGridFileReadStream(file) {
    if (!file._id) throw new Error("Can only read files retrieved from the database")
    if (file.chunkSize instanceof Long) throw new Error("Long (64bit) chunkSize unsupported")
    if (file.chunkSize <= 0) throw new Error("File has invalid chunkSize: "+file.chunkSize)

    stream.Stream.call(this)

    this.file = file
    this.readable = true
    this._chunkCount = file.chunkCount()
    this._chunkIndex = 0

    process.nextTick(this._nextChunk.bind(this))
}
function MongolianGridFileReadStream ( file ) { if ( ! file . _id ) throw new Error ( "Can only read files retrieved from the database" ) if ( file . chunkSize instanceof Long ) throw new Error ( "Long (64bit) chunkSize unsupported" ) if ( file . chunkSize <= 0 ) throw new Error ( "File has invalid chunkSize: " + file . chunkSize ) stream . Stream . call ( this ) this . file = file this . readable = true this . _chunkCount = file . chunkCount ( ) this . _chunkIndex = 0 process . nextTick ( this . _nextChunk . bind ( this ) ) }
Treats a MongolianGridFile as a node.js Readable Stream
Treats a MongolianGridFile as a node . js Readable Stream