Java.Util.Zip.Inflater Class
This class decompresses data that was compressed using the DEFLATE algorithm (see ).

See Also: Inflater Members

Syntax

[Android.Runtime.Register("java/util/zip/Inflater", DoNotGenerateAcw=true)]
public class Inflater : Java.Lang.Object

Remarks

This class decompresses data that was compressed using the DEFLATE algorithm (see ).

It is usually more convenient to use Java.Util.Zip.InflaterInputStream.

To decompress an in-memory byte[] to another in-memory byte[] manually:

java Example

     byte[] compressedBytes = ...
     int decompressedByteCount = ... // From your format's metadata.
     Inflater inflater = new Inflater();
     inflater.setInput(compressedBytes, 0, compressedBytes.length);
     byte[] decompressedBytes = new byte[decompressedByteCount];
     if (inflater.inflate(decompressedBytes) != decompressedByteCount) {
         throw new AssertionError();
     }
     inflater.end();
 

In situations where you don't have all the input in one array (or have so much input that you want to feed it to the inflater in chunks), it's possible to call Inflater.SetInput(Byte[]) repeatedly, but you're much better off using Java.Util.Zip.InflaterInputStream to handle all this for you.

If you don't know how big the decompressed data will be, you can call Inflater.Inflate(Byte[]) repeatedly on a temporary buffer, copying the bytes to a Java.IO.ByteArrayOutputStream, but this is probably another sign you'd be better off using Java.Util.Zip.InflaterInputStream.

[Android Documentation]

Requirements

Namespace: Java.Util.Zip
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1