bundles/org.tukani.xz/src/org/tukaani/xz/DeltaInputStream.java
public int read(byte[] buf, int off, int len) throws IOException {
        if (len == 0)
            return 0;

        if (in == null)
            throw new XZIOException("Stream closed");

        if (exception != null)
            throw exception;

        int size;
        try {
            size = in.read(buf, off, len);
        } catch (IOException e) {
            exception = e;
            throw e;
        }

        if (size == -1)
            return -1;

        delta.decode(buf, off, size);
        return size;
    }
public int read(byte[] buf, int off, int len) throws IOException {
        if (len == 0)
            return 0;

        if (in == null)
            throw new XZIOException("Stream closed");

        if (exception != null)
            throw exception;

        int size;
        try {
            size = in.read(buf, off, len);
        } catch (IOException e) {
            exception = e;
            throw e;
        }

        if (size == -1)
            return -1;

        delta.decode(buf, off, size);
        return size;
    }
Decode into an array of bytes.
<p>
This calls <code>in.read(buf, off, len)</code> and defilters the
returned data.

@param       buf         target buffer for decoded data
@param       off         start offset in <code>buf</code>
@param       len         maximum number of bytes to read

@return      number of bytes read, or <code>-1</code> to indicate
the end of the input stream <code>in</code>

@throws      XZIOException if the stream has been closed

@throws      IOException may be thrown by underlaying input
stream <code>in</code>