private ByteBuffer read(FileChannel channel,int size){
  ByteBuffer byteBffer=ByteBuffer.allocate(size);
  try {
    channel.read(byteBffer);
  }
 catch (  Exception e) {
    LOGGER.error(e,e.getMessage());
  }
  byteBffer.rewind();
  return byteBffer;
}

private ByteBuffer read ( FileChannel channel , int size ) { ByteBuffer byteBffer = ByteBuffer . allocate ( size ) ; try { channel . read ( byteBffer ) ; } catch ( Exception e ) { LOGGER . error ( e , e . getMessage ( ) ) ; } byteBffer . rewind ( ) ; return byteBffer ; }
this method will be used to read from file based on number of bytes to be read and positon
