Please note that onDone
may never be called on failure, you have to listen for both onError and
onDone to identify the end of stream.
Example for .decoder:
Please note that onDone
may never be called on failure, you have to listen for both onError and
onDone to identify the end of stream.
Example for .encoder:
A Converter over a ChunkedSink. Whole input conversion goes through the
chunked path. ZLibDecoder does the same, so there is one behaviour rather
than two
A running CRC-64 over however many pieces the bytes arrive in, on every
backend. The value leaves as eight little endian bytes rather than as an
int, since an int does not hold it where dart2js compiles
Buffered file reader reduces file system disk access by reading in
buffers of the file so that individual file reads
can be read from the cached buffer.
Decompress data with the gzip format decoder.
The actual decoder used will depend on the platform the code is run on.
In a 'dart:io' based platform, like Flutter, the native GZipCodec will
be used to improve performance. On web platforms, a Dart implementation
of ZLib will be used, via the Inflate class.
If you want to force the use of the Dart implementation, you can use the
GZipDecoderWeb class.
Compress data with the GZip format encoder.
The actual encoder used will depend on the platform the code is run on.
In a 'dart:io' based platform, like Flutter, the native GZipCodec will
be used to improve performance. On web platforms, a Dart implementation
of ZLib will be used, via the Deflate class.
If you want to force the use of the Dart implementation, you can use the
GZipEncoderWeb class.
Dart implementation of the ZLib inflate decompression algorithm,
used by ZLibEncoder and GZipEncoder. This is used to decompress
data that was previously compressed by the Deflate algorithm.
Passes every write to output and calls onProgress with the number of
bytes written through it, once per interval bytes and on flush and close.
If onProgress throws, it's Exception goes to the zone without stopping
the decoder/encoder.
Not a standard dart:convertCodec because it doesn't perform simple
byte-to-byte conversions, acting purely as a StreamTransformer.
It reads one entry at a time and holds one entry's header rather than the
whole archive. Content has to be read before the loop moves on, the bytes
are gone once it does. What left unread is skipped.
Metadata from headers that carry no payload but describe the next entry,
such as GNU long names, links, and PAX records. Shared here for both
TarDecoder and the streamed reader
Pass this to the the call to spread it over isolates. You cannot wait for an
isolate synchronously, so the call returns an empty result at once and the
real result goes to onDone, error is placed inside the onError callback.
Without onError a failure goes to onDone as an empty list for
decodeBytes/encodeBytes, the same as an empty archive, or as false for
decodeStream/encodeStream.
XZ decode example:
Writes a zip archive to a Sink entry by entry. When streamed is
disabled, it buffers each entry to compute the CRC and sizes for the local
header, while streamed, the default, writes them after the payload instead
Writes one entry a piece at a time. Call step until it returns false,
then finish. This lets a caller pass the bytes on before the whole entry
is compressed
Decompress data with the zlib format decoder.
The actual decoder used will depend on the platform the code is run on.
In a 'dart:io' based platform, like Flutter, the native ZLibCodec will
be used to improve performance. On web platforms, a Dart implementation
of ZLib will be used, via the Inflate class.
If you want to force the use of the Dart implementation, you can use the
ZLibDecoderWeb class.
Compress data with the zlib format encoder.
The actual encoder used will depend on the platform the code is run on.
In a 'dart:io' based platform, like Flutter, the native ZLibCodec will
be used to improve performance. On web platforms, a Dart implementation
of ZLib will be used, via the Deflate class.
If you want to force the use of the Dart implementation, you can use the
ZLibEncoderWeb class.
zstd -T.
Pass this to the the call to spread it over isolates. You cannot wait for an
isolate synchronously, so the call returns an empty result at once and the
real result goes to onDone, error is placed inside the onError callback.
Without onError a failure goes to onDone as an empty list for
decodeBytes/encodeBytes, the same as an empty archive, or as false for
decodeStream/encodeStream.
XZ decode example:
Dictionary size written to the block header: stored chunks don't need a
dictionary, but decoders require one, and both encoders use the same value
so their output is identical
The four fields that describe the work, checked the same way wherever the
options arrive: a value no path can honour is a mistake at the call, not a
failure of the encode
Throws UnsupportedError on dart2js, where int holds 53 bits. Use Crc64
instead, which holds CRC as two 32-bit halves and returns 8 bytes, so it
works on every backend without speed downgrade for IO
False on dart2js, where int holds 53 bits and getCrc64 cannot return
64-bit value. Use Crc64, which holds CRC as two 32-bit halves and returns
8 bytes, so it works on every backend without speed downgrade for IO
Validates the 512-byte header against its own checksum
(calculated with the checksum field replaced by spaces).
Because tar headers lack strict magic numbers, this is the
only proof that the block is actually a tar header