bundles/org.tukani.xz/src/org/tukaani/xz/XZOutputStream.java
public void flush() throws IOException {
        if (exception != null)
            throw exception;

        if (finished)
            throw new XZIOException("Stream finished or closed");

        try {
            if (blockEncoder != null) {
                if (filtersSupportFlushing) {
                    // This will eventually call out.flush() so
                    // no need to do it here again.
                    blockEncoder.flush();
                } else {
                    endBlock();
                    out.flush();
                }
            } else {
                out.flush();
            }
        } catch (IOException e) {
            exception = e;
            throw e;
        }
    }
public void flush() throws IOException {
        if (exception != null)
            throw exception;

        if (finished)
            throw new XZIOException("Stream finished or closed");

        try {
            if (blockEncoder != null) {
                if (filtersSupportFlushing) {
                    // This will eventually call out.flush() so
                    // no need to do it here again.
                    blockEncoder.flush();
                } else {
                    endBlock();
                    out.flush();
                }
            } else {
                out.flush();
            }
        } catch (IOException e) {
            exception = e;
            throw e;
        }
    }
public void flush ( ) throws IOException { if ( exception != null ) throw exception ; if ( finished ) throw new XZIOException ( "Stream finished or closed" ) ; try { if ( blockEncoder != null ) { if ( filtersSupportFlushing ) { // This will eventually call out.flush() so // no need to do it here again. blockEncoder . flush ( ) ; } else { endBlock ( ) ; out . flush ( ) ; } } else { out . flush ( ) ; } } catch ( IOException e ) { exception = e ; throw e ; } }
Flushes the encoder and calls <code>out.flush()</code>.
All buffered pending data will then be decompressible from
the output stream.
<p>
Calling this function very often may increase the compressed
file size a lot. The filter chain options may affect the size
increase too. For example, with LZMA2 the HC4 match finder has
smaller penalty with flushing than BT4.
<p>
Some filters don't support flushing. If the filter chain has
such a filter, <code>flush()</code> will call <code>endBlock()</code>
before flushing.

@throws      XZIOException
XZ Stream has grown too big

@throws      XZIOException
stream finished or closed

@throws      IOException may be thrown by the underlying output stream
Flushes the encoder and calls <code > out . flush () < / code > . All buffered pending data will then be decompressible from the output stream . <p > Calling this function very often may increase the compressed file size a lot . The filter chain options may affect the size increase too . For example with LZMA2 the HC4 match finder has smaller penalty with flushing than BT4 . <p > Some filters don t support flushing . If the filter chain has such a filter <code > flush () < / code > will call <code > endBlock () < / code > before flushing .