Inflater.InflateAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| InflateAsync(ByteBuffer) |
Runs decompression into a byte buffer as a task. |
| InflateAsync(Byte[]) |
Runs decompression into a byte array as a task. |
| InflateAsync(Byte[], Int32, Int32) |
Runs decompression into a byte array range as a task. |
InflateAsync(ByteBuffer)
Runs decompression into a byte buffer as a task.
public System.Threading.Tasks.Task<int> InflateAsync(Java.Nio.ByteBuffer? output);
member this.InflateAsync : Java.Nio.ByteBuffer -> System.Threading.Tasks.Task<int>
Parameters
- output
- ByteBuffer
The writable buffer that receives uncompressed bytes between its current position and its limit.
Returns
A task whose result is the number of uncompressed bytes written to output, not the number of compressed input bytes consumed.
Remarks
This .NET wrapper uses Task.Run to call Inflate(ByteBuffer). It does not use a native asynchronous operation.
The output position advances by the number of bytes produced. If input was supplied as a byte buffer, its position advances by the number of bytes consumed. These positions and the byte totals reflect progress even if a DataFormatException occurs. Wait for the task to complete before changing these buffers or using this decompressor again.
A result of zero does not by itself mean that decompression is complete. Check Finished(), NeedsInput(), and NeedsDictionary(), and provide output space as needed. If a dictionary is required, Adler identifies its Adler-32 checksum.
Exceptions from the synchronous call, including invalid compressed data or a read-only output buffer, are reported through the task.
.NET asynchronous wrapper implementation.
Android decompression implementation.
Applies to
InflateAsync(Byte[])
Runs decompression into a byte array as a task.
public System.Threading.Tasks.Task<int> InflateAsync(byte[]? output);
member this.InflateAsync : byte[] -> System.Threading.Tasks.Task<int>
Parameters
- output
- Byte[]
The array that receives uncompressed bytes, starting at index zero.
Returns
A task whose result is the number of uncompressed bytes written to output, not the number of compressed input bytes consumed.
Remarks
This .NET wrapper uses Task.Run to call Inflate(Byte[]). It does not use a native asynchronous operation.
The output capacity is the array length. If input was supplied as a byte buffer, its position advances by the number of bytes consumed. The input position and byte totals reflect progress even if a DataFormatException occurs. Wait for the task to complete before changing these buffers or using this decompressor again.
A result of zero does not by itself mean that decompression is complete. Check Finished(), NeedsInput(), and NeedsDictionary(), and provide output space as needed. If a dictionary is required, Adler identifies its Adler-32 checksum. Exceptions from the synchronous call are reported through the task.
.NET asynchronous wrapper implementation.
Android decompression implementation.
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.
Applies to
InflateAsync(Byte[], Int32, Int32)
Runs decompression into a byte array range as a task.
public System.Threading.Tasks.Task<int> InflateAsync(byte[]? output, int off, int len);
member this.InflateAsync : byte[] * int * int -> System.Threading.Tasks.Task<int>
Parameters
- output
- Byte[]
The array that receives uncompressed bytes.
- off
- Int32
The index in output at which to start writing.
- len
- Int32
The maximum number of uncompressed bytes to write.
Returns
A task whose result is the number of uncompressed bytes written to the specified range, not the number of compressed input bytes consumed.
Remarks
This .NET wrapper uses Task.Run to call Inflate(Byte[], Int32, Int32). It does not use a native asynchronous operation.
If input was supplied as a byte buffer, its position advances by the number of bytes consumed. The input position and byte totals reflect progress even if a DataFormatException occurs. Wait for the task to complete before changing the input or output buffers or using this decompressor again.
A result of zero does not by itself mean that decompression is complete. Check Finished(), NeedsInput(), and NeedsDictionary(), and provide output space as needed. If a dictionary is required, Adler identifies its Adler-32 checksum. Exceptions from the synchronous call are reported through the task.
.NET asynchronous wrapper implementation.
Android decompression implementation.
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.