Java 8 Inflater - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Inflater class.

This code example shows how to use the following methods: end, inflate, setInput
    return "B1"; 
  } 
 
  protected byte[] decompress(byte input[], int len) {
    int olen = 0;
    Inflater decompresser = new Inflater();
    byte output[] = new byte[len];
    decompresser.setInput(input);
    try { 
      olen = decompresser.inflate(output);
    } catch(java.util.zip.DataFormatException e) {
    } 
    decompresser.end();
    if(len != olen) return new byte[0];
    return output;
  } 
 
  public NoitBundlev1() {} 
  public NoitBundlev1(String[] parts) throws Exception {
    super(parts);
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: end, finished, inflate, setInput
 
    // This comes from the Apache Hive ORC code 
    private int decompressZip(Slice in)
            throws IOExceptionInflater inflater = new Inflater(true);
        try { 
            inflater.setInput((byte[]) in.getBase(), (int) (in.getAddress() - ARRAY_BYTE_BASE_OFFSET), in.length());
            allocateOrGrowBuffer(in.length() * EXPECTED_COMPRESSION_RATIO, false);
            int uncompressedLength = 0;
            while (true) { 
                uncompressedLength += inflater.inflate(buffer, uncompressedLength, buffer.length - uncompressedLength);
                if (inflater.finished() || buffer.length >= maxBufferSize) {
                    break; 
                } 
                int oldBufferSize = buffer.length;
                allocateOrGrowBuffer(buffer.length * 2, true);
                if (buffer.length <= oldBufferSize) {
                    throw new IllegalStateException(String.format("Buffer failed to grow. Old size %d, current size %d", oldBufferSize, buffer.length));
                } 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: finished, getBytesRead, getBytesWritten, getRemaining
     *  Moved from i2ptunnel HTTPResponseOutputStream.InternalGZIPInputStream 
     *  @since 0.8.9 
     */ 
    public long getTotalRead() { 
        try { 
            return inf.getBytesRead(); 
        } catch (Exception e) {
            return 0; 
        } 
    } 
 
    /** 
     *  Moved from i2ptunnel HTTPResponseOutputStream.InternalGZIPInputStream 
     *  @since 0.8.9 
     */ 
    public long getTotalExpanded() {  
        try { 
            return inf.getBytesWritten(); 
        } catch (Exception e) {
            // possible NPE in some implementations 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: end, getAdler, inflate, setInput
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: inflate, reset, setInput
            out.add( in.readBytes( in.readableBytes() ) );
        } else 
        { 
            byte[] compressedData = new byte[ in.readableBytes() ];
            in.readBytes( compressedData );
            inflater.setInput( compressedData );
 
            byte[] data = new byte[ size ];
            inflater.inflate( data );
            out.add( Unpooled.wrappedBuffer( data ) );
            inflater.reset();
        } 
    } 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 Inflater Questions & Answers:

See Code Examples for Java 8 Inflater Methods: