public void writeTo(byte[] bytes,int offset) throws IOException {
  flush();
  final long end=file.length;
  long pos=0;
  int buffer=0;
  int bytesUpto=offset;
  while (pos < end) {
    int length=BUFFER_SIZE;
    long nextPos=pos + length;
    if (nextPos > end) {
      length=(int)(end - pos);
    }
    System.arraycopy(file.getBuffer(buffer++),0,bytes,bytesUpto,length);
    bytesUpto+=length;
    pos=nextPos;
  }
}

public void writeTo ( byte [ ] bytes , int offset ) throws IOException { flush ( ) ; final long end = file . length ; long pos = 0 ; int buffer = 0 ; int bytesUpto = offset ; while ( pos < end ) { int length = BUFFER_SIZE ; long nextPos = pos + length ; if ( nextPos > end ) { length = ( int ) ( end - pos ) ; } System . arraycopy ( file . getBuffer ( buffer ++ ) , 0 , bytes , bytesUpto , length ) ; bytesUpto += length ; pos = nextPos ; } }
copy the current contents of this buffer to output byte array
