Inflater Class

Definition

This class provides support for general purpose decompression using the popular ZLIB compression library.

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

Remarks

This class provides support for general purpose decompression using the popular ZLIB compression library. The ZLIB compression library was initially developed as part of the PNG graphics standard and is not protected by patents. It is fully described in the specifications at the java.util.zip package description.

The following code fragment demonstrates a trivial compression and decompression of a string using Deflater and Inflater.

<blockquote>

try {
                // Encode a String into bytes
                String inputString = "blahblahblah\u20AC\u20AC";
                byte[] input = inputString.getBytes("UTF-8");

                // Compress the bytes
                byte[] output = new byte[100];
                Deflater compresser = new Deflater();
                compresser.setInput(input);
                compresser.finish();
                int compressedDataLength = compresser.deflate(output);

                // Decompress the bytes
                Inflater decompresser = new Inflater();
                decompresser.setInput(output, 0, compressedDataLength);
                byte[] result = new byte[100];
                int resultLength = decompresser.inflate(result);
                decompresser.end();

                // Decode the bytes into a String
                String outputString = new String(result, 0, resultLength, "UTF-8");
            } catch(java.io.UnsupportedEncodingException ex) {
                // handle
            } catch (java.util.zip.DataFormatException ex) {
                // handle
            }

</blockquote>

Java documentation for java.util.zip.Inflater.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Inflater()

Creates a new decompressor.

Inflater(Boolean)

Creates a new decompressor.

Inflater(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Adler

Returns the ADLER-32 value of the uncompressed data.

BytesRead

Returns the total number of compressed bytes input so far.

BytesWritten

Returns the total number of uncompressed bytes output so far.

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
Remaining

Returns the total number of bytes remaining in the input buffer.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

TotalIn

Returns the total number of compressed bytes input so far.

TotalOut

Returns the total number of uncompressed bytes output so far.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
End()

Closes the decompressor and discards any unprocessed input.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
Finished()

Returns true if the end of the compressed data stream has been reached.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
Inflate(Byte[])

Uncompresses bytes into specified buffer.

Inflate(Byte[], Int32, Int32)

Uncompresses bytes into specified buffer.

InflateAsync(Byte[])
InflateAsync(Byte[], Int32, Int32)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
NeedsDictionary()

Returns true if a preset dictionary is needed for decompression.

NeedsInput()

Returns true if no data remains in the input buffer.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Reset()

Resets inflater so that a new set of input data can be processed.

SetDictionary(Byte[])

Sets the preset dictionary to the given array of bytes.

SetDictionary(Byte[], Int32, Int32)

Sets the preset dictionary to the given array of bytes.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetInput(Byte[])

Sets input data for decompression.

SetInput(Byte[], Int32, Int32)

Sets input data for decompression.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to