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

API Browser

Method

Read

func Read(buffer: byte[], offset: int, count: int, cancellationToken: CancellationToken = default) -> Task<Result<int, StreamError>>

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

Implements InputStream.Read

Validates the complete bounded gzip input before exposing decompressed bytes.

Parameters

Name Type Description
buffer Byte[] Destination; unchanged on invalid input or quota failure.
offset Int32 First writable index.
count Int32 Maximum bytes; zero does not consume input.
cancellationToken CancellationToken Pre-cancellation preserves state. Cancellation after input begins poisons the wrapper.

Return value

Task<Result<Int32, StreamError>>

Bytes read, zero at EOF, or Closed, WrongAccess, InvalidRange, InvalidData, LimitExceeded or an underlying error. Later calls after failure return IoFailure.