public void flush() throws Exception {
  if (writingChannel != null) {
    sequentialFile.position(0);
    writingChannel.writerIndex(writingChannel.capacity());
    sequentialFile.writeDirect(writingChannel.toByteBuffer(),true);
    sequentialFile.close();
    newDataFiles.add(currentFile);
  }
  writingChannel=null;
}

public void flush ( ) throws Exception { if ( writingChannel != null ) { sequentialFile . position ( 0 ) ; writingChannel . writerIndex ( writingChannel . capacity ( ) ) ; sequentialFile . writeDirect ( writingChannel . toByteBuffer ( ) , true ) ; sequentialFile . close ( ) ; newDataFiles . add ( currentFile ) ; } writingChannel = null ; }
write pending output into file
