BZip2ChunkedEncoder class

Writes a bzip2 archive over data that arrives in pieces.

Buffers data until a block is full, then encodes it. This guarantees the exact same output as calling encodeBytes on BZip2Encoder. It only keeps one block in memory at a time, regardless of the overall file size.

Inheritance

Constructors

BZip2ChunkedEncoder(Sink<List<int>> output, {int blockSize100k = 9})

Properties

available → int
How many bytes have arrived and not been read
no setterinherited
blockSize100k → int
final
consumed ↔ int
Bytes read so far. A format measures its padding and its own lengths against this
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
output → Sink<List<int>>
Where the result goes, one piece at a time
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
unitAtATime ↔ bool
When set, step returns after one unit of the format, a block or a chunk. ChunkedSinkDecoder sets it, since an input of a few bytes can decode to gigabytes in one call otherwise
getter/setter pairinherited

Methods

add(List<int> chunk) → void
Adds chunked data to this sink.
inherited
addSlice(List<int> chunk, int start, int end, bool isLast) → void
Takes part of a buffer without creating a view of it first, as ByteConversionSink allows
inherited
close() → void
Closes output only if the input ended cleanly. On a failed parse it stays open, the same as gzip.decoder and zlib.decoder in dart:io, so you have to close your own file or socket. The first close after a failure reports it, and a close after that returns without doing anything, as dart:io does. add after a failure reports it every time
inherited
finish() → void
What the format needs before the input may end. Called once, after the last step, and only when nothing has failed
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resume() → void
Runs the parse again over what is already held, for a subclass that stopped on something other than a short field
inherited
skip(int count) → void
Marks count bytes as read
inherited
step() → void
Reads what has arrived and returns at the first field that is not all here yet. Called again with more bytes behind it
override
toString() → String
A string representation of this object.
inherited
view(int count) → Uint8List
The next count bytes without copying them. Only valid until the call that reads them returns, since it may be a view of the incoming piece
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited