Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public byte[] deflate(byte[] data) throws IOException, DataFormatException {
- Inflater inflater = new Inflater();
- inflater.setInput(data);
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream(data.length);
- byte[] buffer = new byte[1024];
- while (!inflater.finished()) {
- int count = inflater.inflate(buffer);
- outputStream.write(buffer, 0, count);
- }
- outputStream.close();
- byte[] output = outputStream.toByteArray();
- return output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement