@Override public void write(byte[] buffer,int offset,int length,boolean isEnd) throws IOException {
  int position=_position;
  if (length < 0) {
    throw new IllegalArgumentException();
  }
  if (_indexAddress < position + length) {
    throw new IllegalArgumentException(L.l("Segment write overflow pos=0x{0} len=0x{1} entry-head=0x{2} seg-len=0x{3}. {4}",Long.toHexString(_position),Long.toHexString(length),Long.toHexString(_indexAddress),Long.toHexString(_segment.length()),_segment));
  }
  _sOut.write(_segment.getAddress() + position,buffer,offset,length);
  _position=position + length;
  _isDirty=true;
}

@ Override public void write ( byte [ ] buffer , int offset , int length , boolean isEnd ) throws IOException { int position = _position ; if ( length < 0 ) { throw new IllegalArgumentException ( ) ; } if ( _indexAddress < position + length ) { throw new IllegalArgumentException ( L . l ( "Segment write overflow pos=0x{0} len=0x{1} entry-head=0x{2} seg-len=0x{3}. {4}" , Long . toHexString ( _position ) , Long . toHexString ( length ) , Long . toHexString ( _indexAddress ) , Long . toHexString ( _segment . length ( ) ) , _segment ) ) ; } _sOut . write ( _segment . getAddress ( ) + position , buffer , offset , length ) ; _position = position + length ; _isDirty = true ; }
writes to the file from the writestream flush . after the write , a read from the mmap will succeed , but the headers cannot be written until after the fsync .
