Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.ning.compress;
 
 import java.io.*;

Simple wrapper or wrapper around Uncompressor, to help with inter-operability.
 
 public class UncompressorOutputStream extends OutputStream
    protected final Uncompressor _uncompressor;
    private byte[] _singleByte = null;
    
    public UncompressorOutputStream(Uncompressor uncomp)
    {
         = uncomp;
    }

    
Call to this method will result in call to Uncompressor.complete(), which is idempotent (i.e. can be called multiple times without ill effects).
    @Override
    public void close() throws IOException {
        .complete();
    }
    @Override
    public void flush() { }
    @Override
    public void write(byte[] bthrows IOException {
        .feedCompressedData(b, 0, b.length);
    }
    @Override
    public void write(byte[] bint offint lenthrows IOException {
        .feedCompressedData(bofflen);
    }
    @Override
    public void write(int b)  throws IOException
    {
        if ( == null) {
             = new byte[1];
        }
        [0] = (byteb;
    }
    
New to GrepCode? Check out our FAQ X