@ Nonnull @ Weight ( Weight . Unit . VARIABLE ) public static byte [ ] unpackData ( @ Nonnull final byte [ ] data ) { final Inflater decompressor = new Inflater ( ) ; decompressor . setInput ( Assertions . assertNotNull ( data ) ) ; final ByteArrayOutputStream outStream = new ByteArrayOutputStream ( data . length * 2 ) ; final byte [ ] buffer = new byte [ 1024 ] ; try { while ( ! decompressor . finished ( ) ) { outStream . write ( buffer , 0 , decompressor . inflate ( buffer ) ) ; } return outStream . toByteArray ( ) ; } catch ( DataFormatException ex ) { MetaErrorListeners . fireError ( "Can't unpack data for wrong format" , ex ) ; throw new IllegalArgumentException ( "Wrong formatted data" , ex ) ; } }
Unpack binary data packed by the packData method .