public static byte [ ] decompressFast ( byte [ ] src , int srcOffset , int exactDecompressedSize ) { if ( src == null ) { throw new IllegalArgumentException ( "src must not be null." ) ; } if ( srcOffset < 0 ) { throw new IllegalArgumentException ( "srcOffset must equal to or larger than 0 but " + srcOffset ) ; } if ( exactDecompressedSize < 0 ) { throw new IllegalArgumentException ( "exactDecompressedSize must equal to or larger than 0 but " + exactDecompressedSize ) ; } LZ4FastDecompressor decompressor = factory . fastDecompressor ( ) ; return decompressor . decompress ( src , srcOffset , exactDecompressedSize ) ; }
When the exact decompressed size is known use this method to decompress . It s faster .