Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public byte[] deflate(byte[] data) throws IOException, DataFormatException {
  2. Inflater inflater = new Inflater();
  3. inflater.setInput(data);
  4. ByteArrayOutputStream outputStream = new ByteArrayOutputStream(data.length);
  5. byte[] buffer = new byte[1024];
  6. while (!inflater.finished()) {
  7. int count = inflater.inflate(buffer);
  8. outputStream.write(buffer, 0, count);
  9. }
  10. outputStream.close();
  11. byte[] output = outputStream.toByteArray();
  12. return output;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement