public void writeRawBytes(final byte[] value,int offset,int length) throws IOException {
  if (limit - position >= length) {
    System.arraycopy(value,offset,buffer,position,length);
    position+=length;
  }
 else {
    final int bytesWritten=limit - position;
    System.arraycopy(value,offset,buffer,position,bytesWritten);
    offset+=bytesWritten;
    length-=bytesWritten;
    position=limit;
    refreshBuffer();
    if (length <= limit) {
      System.arraycopy(value,offset,buffer,0,length);
      position=length;
    }
 else {
      output.write(value,offset,length);
    }
  }
}

public void writeRawBytes ( final byte [ ] value , int offset , int length ) throws IOException { if ( limit - position >= length ) { System . arraycopy ( value , offset , buffer , position , length ) ; position += length ; } else { final int bytesWritten = limit - position ; System . arraycopy ( value , offset , buffer , position , bytesWritten ) ; offset += bytesWritten ; length -= bytesWritten ; position = limit ; refreshBuffer ( ) ; if ( length <= limit ) { System . arraycopy ( value , offset , buffer , 0 , length ) ; position = length ; } else { output . write ( value , offset , length ) ; } } }
write part of an array of bytes .
