slumberdb/slumberdb-service-model/src/main/java/org/boon/slumberdb/stores/log/BatchFileWriter.java
private void write(final ByteBuffer bufferOut) throws InterruptedException {

        initOutputStream();
        try {
            if (outputStream != null) {

                outputStream.write(bufferOut);

            } else {
                error.set(true);
            }

            if (bytesSinceLastFlush > FLUSH_EVERY_N_BYTES) {
                syncToDisk();
                bytesSinceLastFlush = 0;
            }
        } catch (ClosedByInterruptException cbie) {
            throw new InterruptedException("File closed by interruption");
        } catch (Exception e) {
            cleanupOutputStream();
            error.set(true);
            e.printStackTrace(System.err);

            diagnose();

            Exceptions.handle(e);
        }

    }
private void write(final ByteBuffer bufferOut) throws InterruptedException {

        initOutputStream();
        try {
            if (outputStream != null) {

                outputStream.write(bufferOut);

            } else {
                error.set(true);
            }

            if (bytesSinceLastFlush > FLUSH_EVERY_N_BYTES) {
                syncToDisk();
                bytesSinceLastFlush = 0;
            }
        } catch (ClosedByInterruptException cbie) {
            throw new InterruptedException("File closed by interruption");
        } catch (Exception e) {
            cleanupOutputStream();
            error.set(true);
            e.printStackTrace(System.err);

            diagnose();

            Exceptions.handle(e);
        }

    }
private void write ( final ByteBuffer bufferOut ) throws InterruptedException { initOutputStream ( ) ; try { if ( outputStream != null ) { outputStream . write ( bufferOut ) ; } else { error . set ( true ) ; } if ( bytesSinceLastFlush > FLUSH_EVERY_N_BYTES ) { syncToDisk ( ) ; bytesSinceLastFlush = 0 ; } } catch ( ClosedByInterruptException cbie ) { throw new InterruptedException ( "File closed by interruption" ) ; } catch ( Exception e ) { cleanupOutputStream ( ) ; error . set ( true ) ; e . printStackTrace ( System . err ) ; diagnose ( ) ; Exceptions . handle ( e ) ; } }
Write the actual data to disk.
Write the actual data to disk .