Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Class

GZipStream

class GZipStream

Module: System.IO.Compression
Assembly: System.Runtime.dll
Source file: GZipStream.rvn

Inheritance: Object → GZipStream
Implements: InputStream, OutputStream

Gzip compression and bounded, validated decompression over asynchronous byte streams.

Remarks

Sequential operations only. Compression writes incrementally; await Finish before Close. Decompression buffers to EOF, accepting at most 65536 compressed and 65536 decoded bytes across all members. No seek, compression-level selection or automatic HTTP encoding is supplied.

Methods

11 items
Close() -> () Discards wrapper state and closes the underlying stream unless leaveOpen was selected; idempotent. Implements InputStream.Close, OutputStream.Close
Static member: CreateCompressor(output: OutputStream, leaveOpen?: bool) -> GZipStream Creates an incremental compressor using fixed Huffman DEFLATE with LZ77 matching.
Static member: CreateDecompressor(input: InputStream, leaveOpen?: bool) -> GZipStream Creates a decoder for stored, fixed and dynamic DEFLATE blocks and concatenated gzip members.
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
Finish(cancellationToken?: CancellationToken) -> Task<Result<void, StreamError>> Writes the final DEFLATE block, CRC32 and modulo-2^32 input size exactly once, including for empty input.
Flush(cancellationToken?: CancellationToken) -> Task<Result<void, StreamError>> Flushes output already accepted; does not finalize gzip or emit a trailer. Implements OutputStream.Flush
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
Read(buffer: byte[], offset: int, count: int, cancellationToken?: CancellationToken) -> Task<Result<int, StreamError>> Validates the complete bounded gzip input before exposing decompressed bytes. Implements InputStream.Read
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString
Write(buffer: byte[], offset: int, count: int, cancellationToken?: CancellationToken) -> Task<Result<void, StreamError>> Compresses the full range in bounded 16384-byte blocks without retaining caller bytes after completion. Implements OutputStream.Write