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

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

        // NOTE: Once there is threading with multiple Blocks, it's possible
        // that this function will be more like a barrier that returns
        // before the last Block has been finished.
        if (blockEncoder != null) {
            try {
                blockEncoder.finish();
                index.add(blockEncoder.getUnpaddedSize(),
                          blockEncoder.getUncompressedSize());
                blockEncoder = null;
            } catch (IOException e) {
                exception = e;
                throw e;
            }
        }
    }
public void endBlock() throws IOException {
        if (exception != null)
            throw exception;

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

        // NOTE: Once there is threading with multiple Blocks, it's possible
        // that this function will be more like a barrier that returns
        // before the last Block has been finished.
        if (blockEncoder != null) {
            try {
                blockEncoder.finish();
                index.add(blockEncoder.getUnpaddedSize(),
                          blockEncoder.getUncompressedSize());
                blockEncoder = null;
            } catch (IOException e) {
                exception = e;
                throw e;
            }
        }
    }
Finishes the current XZ Block (but not the whole XZ Stream).
This doesn't flush the stream so it's possible that not all data will
be decompressible from the output stream when this function returns.
Call also <code>flush()</code> if flushing is wanted in addition to
finishing the current XZ Block.
<p>
If there is no unfinished Block open, this function will do nothing.
(No empty XZ Block will be created.)
<p>
This function can be useful, for example, to create
random-accessible .xz files.
<p>
Starting a new XZ Block means that the encoder state is reset.
Doing this very often will increase the size of the compressed
file a lot (more than plain <code>flush()</code> would do).

@throws      XZIOException
XZ Stream has grown too big

@throws      XZIOException
stream finished or closed

@throws      IOException may be thrown by the underlying output stream