Java Decompress Byte Array decompress(byte[] src, Inflater decompresser, int compressCycleSize)

Here you can find the source of decompress(byte[] src, Inflater decompresser, int compressCycleSize)

Description

decompress

License

GNU General Public License

Declaration

private static byte[] decompress(byte[] src, Inflater decompresser, int compressCycleSize) throws Exception 

Method Source Code

//package com.java2s;
/**/*from w w w  .j  ava  2s  .  com*/
 * okuyama???????????????Api??????????????????.<br>
 *
 * @author T.Okuyama
 * @license GPL(Lv3)
 */

import java.io.*;

import java.util.zip.*;

public class Main {
    private static byte[] decompress(byte[] src, Inflater decompresser, int compressCycleSize) throws Exception {

        ByteArrayOutputStream decompos = new ByteArrayOutputStream();

        try {

            decompresser.setInput(src);

            byte[] buf = new byte[compressCycleSize];
            int count = 0;
            while (!decompresser.finished()) {
                count = decompresser.inflate(buf);
                decompos.write(buf, 0, count);
            }
            return decompos.toByteArray();
        } catch (Exception e) {
            throw e;
        }
    }
}

Related

  1. decompress(byte[] gzipped)
  2. decompress(byte[] in)
  3. decompress(byte[] input)
  4. decompress(byte[] source)
  5. decompress(byte[] source)
  6. decompress(byte[] str)
  7. decompress(byte[] zipByte)
  8. decompress(final byte[] compressed)
  9. decompress(final DataInputStream input, final byte[] result, int offset, int length)