abla/compression/gzip
Generated from source.
Import with import "abla/compression/gzip".
Source: abla/compression/gzip/entry.ab
DeflateBitWriter (class)
class DeflateBitWriter(
val output: ByteBuffer,
var bits: int,
var count: int,
var memory: int,
var length: int
)
Tracks pending bits and the destination buffer for a DEFLATE stream.
gzipCompress (fun)
fun gzipCompress(input: string, searchLimit: int = 128): string
input as a gzip member (RFC 1952). searchLimit bounds the work of the match search: at most that many (up to 4096) candidates are compared at each position.
GzipDecompressResult (class)
class GzipDecompressResult(val data: string, val error: string)
Exactly one gzip member; error is empty, "invalid", or "limit".
gzipDecompress (fun)
fun gzipDecompress(input: string, maxOutputBytes: int): GzipDecompressResult
Supports exactly one member. Concatenated members and trailing bytes are rejected. Decodes a single gzip member from input with at most maxOutputBytes bytes of output. Returns empty data and a nonempty error for invalid input, trailing bytes, extra members, or a limit violation.
GzipInputChunk (class)
class GzipInputChunk(val data: string, val eof: bool, val error: string = "")
A source may return data and EOF together. Empty data without EOF is an error; an error from the source is reported as "source" by the decoder.
GzipStreamChunk (class)
class GzipStreamChunk(val data: string, val done: bool, val error: string)
A read result. data contains decoded bytes, done indicates the verified end of the member, and a nonempty error reports failure.
GzipSource (interface)
resource interface GzipSource
Supplies compressed input on demand. Return at most the requested byte count, marking EOF on the last chunk. An empty chunk without EOF or a reported source error fails decoding.
GzipSource.readChunk (method)
fun readChunk(maxBytes: int): GzipInputChunk
Returns the next bounded input chunk with EOF or a source error marked in the result.
GzipStream (class)
class GzipStream(
val reader: StreamInflateReader,
val maxOutputBytes: int,
val window: StreamInflateWindow,
var total: int = 0,
var crc: int = 4294967295,
var state: int = 0,
var finalBlock: bool = false,
var remaining: int = 0,
var distance: int = 0,
var trees: StreamInflateTrees = StreamInflateTrees(StreamInflateTree([], [], false),
StreamInflateTree([], [], false),
false),
var error: string = ""
)
The stream owns its decoder state, and no output is final until done=true. Error is "invalid", "limit", or "source". At most 65536 output bytes are returned per read. Exactly one member is accepted, including its trailer. Pass the same source object to the constructor and every read; the caller keeps ownership of the source and its resources.
gzipStream (fun)
fun gzipStream(var source: GzipSource, maxInputBytes: int,
maxOutputBytes: int): GzipStream
Validates the header incrementally without retaining untrusted optional fields. Starts a decoder over source and consumes the gzip header. maxInputBytes and maxOutputBytes cap compressed and decoded data. Header and limit errors surface on the first read.
GzipStream.read (extension fun)
fun GzipStream.read(var source: GzipSource, maxBytes: int): GzipStreamChunk
Bytes produced before done=true are provisional: the trailer and end of source may still fail validation. maxBytes must be positive. Decodes up to maxBytes bytes from the same source, capped at 65536 per call. Nonpositive sizes return an invalid error. Check done for verified completion, or error for decode, limit, or source failure.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.