public int read(ByteBuffer dst,int dstStart,int dstLength) throws IOException {
  final int remaining=(int)Math.min(this.length - this.position,Integer.MAX_VALUE);
  final int read=Math.min(remaining,dstLength);
  final int bufferPosition=checkOffset(position,read);
  final long srcAddress=PlatformDependent.directBufferAddress(lastMapped) + bufferPosition;
  if (dst.isDirect()) {
    final long dstAddress=PlatformDependent.directBufferAddress(dst) + dstStart;
    PlatformDependent.copyMemory(srcAddress,dstAddress,read);
  }
 else {
    final byte[] dstArray=dst.array();
    PlatformDependent.copyMemory(srcAddress,dstArray,dstStart,read);
  }
  position+=read;
  return read;
}

public int read ( ByteBuffer dst , int dstStart , int dstLength ) throws IOException { final int remaining = ( int ) Math . min ( this . length - this . position , Integer . MAX_VALUE ) ; final int read = Math . min ( remaining , dstLength ) ; final int bufferPosition = checkOffset ( position , read ) ; final long srcAddress = PlatformDependent . directBufferAddress ( lastMapped ) + bufferPosition ; if ( dst . isDirect ( ) ) { final long dstAddress = PlatformDependent . directBufferAddress ( dst ) + dstStart ; PlatformDependent . copyMemory ( srcAddress , dstAddress , read ) ; } else { final byte [ ] dstArray = dst . array ( ) ; PlatformDependent . copyMemory ( srcAddress , dstArray , dstStart , read ) ; } position += read ; return read ; }
reads a sequence of bytes from this file into the given buffer . < p > < p > bytes are read starting at this file ' s current position , and then the position is updated with the number of bytes actually read .
