code: public boolean write(byte []buffer, int offset, int length)
    {
      if (length == 0) {
        return true; // throw new IllegalStateException();
      }
      
      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;
    }
docs: 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.