lib/blockdevice.js
function( fromLBA, toLBA, buffer, callback ) {

    fromLBA = fromLBA || 0
    toLBA = toLBA || ( fromLBA + 1 )

    if( fromLBA > toLBA ) {
      var swap = fromLBA
      fromLBA = toLBA
      toLBA = swap
      swap = void 0
    }

    if( typeof buffer === 'function' ) {
      callback = buffer
      buffer = null
    }

    var self = this
    var from = this.blockSize * fromLBA
    var to = this.blockSize * toLBA

    debug( 'read_blocks', fromLBA, toLBA, buffer && buffer.length )

    this._read( from, to - from, buffer, callback )

    return this

  }
function( fromLBA, toLBA, buffer, callback ) {

    fromLBA = fromLBA || 0
    toLBA = toLBA || ( fromLBA + 1 )

    if( fromLBA > toLBA ) {
      var swap = fromLBA
      fromLBA = toLBA
      toLBA = swap
      swap = void 0
    }

    if( typeof buffer === 'function' ) {
      callback = buffer
      buffer = null
    }

    var self = this
    var from = this.blockSize * fromLBA
    var to = this.blockSize * toLBA

    debug( 'read_blocks', fromLBA, toLBA, buffer && buffer.length )

    this._read( from, to - from, buffer, callback )

    return this

  }
function ( fromLBA , toLBA , buffer , callback ) { fromLBA = fromLBA || 0 toLBA = toLBA || ( fromLBA + 1 ) if ( fromLBA > toLBA ) { var swap = fromLBA fromLBA = toLBA toLBA = swap swap = void 0 } if ( typeof buffer === 'function' ) { callback = buffer buffer = null } var self = this var from = this . blockSize * fromLBA var to = this . blockSize * toLBA debug ( 'read_blocks' , fromLBA , toLBA , buffer && buffer . length ) this . _read ( from , to - from , buffer , callback ) return this }
Reads from one LBA to another
@param  {Number} fromLBA
@param  {Number} toLBA
@param  {Buffer} buffer (optional)
@param  {Function} callback( error, buffer, bytesRead )
@return {BlockDevice}
Reads from one LBA to another