Search in sources :

Example 6 with InflaterOutputStream

use of java.util.zip.InflaterOutputStream in project voltdb by VoltDB.

the class HashinatorLite method gunzipBytes.

// copy and pasted code below from the compression service
// to avoid linking all that jazz into the client code
public static byte[] gunzipBytes(byte[] compressedBytes) throws IOException {
    ByteArrayOutputStream bos = new ByteArrayOutputStream((int) (compressedBytes.length * 1.5));
    InflaterOutputStream dos = new InflaterOutputStream(bos);
    dos.write(compressedBytes);
    dos.close();
    return bos.toByteArray();
}
Also used : InflaterOutputStream(java.util.zip.InflaterOutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream)

Aggregations

InflaterOutputStream (java.util.zip.InflaterOutputStream)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)5 OutputStream (java.io.OutputStream)2