Android Byte Array Zip zipit(byte[] paramArrayOfByte)

Here you can find the source of zipit(byte[] paramArrayOfByte)

Description

zipit

Declaration

private static byte[] zipit(byte[] paramArrayOfByte) 

Method Source Code

//package com.java2s;

import java.io.ByteArrayOutputStream;

import java.io.IOException;

import java.util.zip.GZIPOutputStream;

public class Main {
    private static byte[] zipit(byte[] paramArrayOfByte) {
        ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
        try {/*from w  w w  .j a v  a2 s .c om*/
            GZIPOutputStream localGZIPOutputStream = new GZIPOutputStream(
                    localByteArrayOutputStream);
            localGZIPOutputStream.write(paramArrayOfByte);
            localGZIPOutputStream.close();
            return localByteArrayOutputStream.toByteArray();
        } catch (IOException localIOException) {
            throw new RuntimeException(localIOException);
        }
    }
}

Related

  1. compress(byte[] data)
  2. compress(byte[] data)
  3. compress(byte[] paramArrayOfByte)