public static byte [ ] decompress ( byte [ ] value ) throws DataFormatException { // Create an expandable byte array to hold the decompressed data ByteArrayOutputStream bos = new ByteArrayOutputStream ( value . length ) ; Inflater decompressor = new Inflater ( ) ; try { decompressor . setInput ( value ) ; final byte [ ] buf = new byte [ 1024 ] ; while ( ! decompressor . finished ( ) ) { int count = decompressor . inflate ( buf ) ; bos . write ( buf , 0 , count ) ; } } finally { decompressor . end ( ) ; } return bos . toByteArray ( ) ; }
Decompress the byte array previously returned by compress