void read(BlockId blk,IoBuffer buffer){
  try {
    IoChannel fileChannel=getFileChannel(blk.fileName());
    buffer.clear();
    fileChannel.read(buffer,blk.number() * BLOCK_SIZE);
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw new RuntimeException("cannot read block " + blk);
  }
}

void read ( BlockId blk , IoBuffer buffer ) { try { IoChannel fileChannel = getFileChannel ( blk . fileName ( ) ) ; buffer . clear ( ) ; fileChannel . read ( buffer , blk . number ( ) * BLOCK_SIZE ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw new RuntimeException ( "cannot read block " + blk ) ; } }
reads the contents of a disk block into a byte buffer .
