public boolean write(byte[] buffer,int offset,int length){
  if (length == 0) {
    return true;
  }
  int count=length / BLOCK_SIZE + 1;
  if (_tailAddress <= _index + length + PAD+ 2 * count) {
    return false;
  }
  _crc.update(buffer,offset,length);
  byte[] headerBuffer=_headerBuffer;
  while (length > 0) {
    int sublen=Math.min(length,BLOCK_SIZE);
    BitsUtil.writeInt16(headerBuffer,0,sublen);
    writeImpl(headerBuffer,0,2);
    writeImpl(buffer,offset,sublen);
    length-=sublen;
    offset+=sublen;
  }
  return true;
}

public boolean write ( byte [ ] buffer , int offset , int length ) { if ( length == 0 ) { return true ; } int count = length / BLOCK_SIZE + 1 ; if ( _tailAddress <= _index + length + PAD + 2 * count ) { return false ; } _crc . update ( buffer , offset , length ) ; byte [ ] headerBuffer = _headerBuffer ; while ( length > 0 ) { int sublen = Math . min ( length , BLOCK_SIZE ) ; BitsUtil . writeInt16 ( headerBuffer , 0 , sublen ) ; writeImpl ( headerBuffer , 0 , 2 ) ; writeImpl ( buffer , offset , sublen ) ; length -= sublen ; offset += sublen ; } return true ; }
writes a partial journal entry . the entry will only be completed after completewrite ( ) has been called . the write will return false if the journal segment is full . the caller needs to retry the write with a new segment .
