Deflate class
Dart implementation of the ZLib deflate compression algorithm,
used by ZLibEncoder and GZipEncoder
.
Constructors
-
Deflate.new(List<
int> bytes, {int level = DeflateLevel.defaultCompression, int windowBits = maxWindowBits, OutputStream? output}) -
Deflate the given
bytes
.level
is the compression level to use for the deflate algorithm. If not provided, the default level of 6 is used. Ifoutput
is provided, the compressed data will be written to that OutputStream, otherwise the compressed data will be accessed from thegetBytes
method. - Deflate.stream(InputStream _input, {int level = DeflateLevel.defaultCompression, int windowBits = maxWindowBits, OutputStream? output})
-
Deflate the given InputStream
_input
._input
can be null, which means it won't start compressing any data in the constructor and you can useaddStream
to compress incoming data in chunks, followed byfinish
to finalize the compression.level
is the compression level to use for the deflate algorithm. If not provided, the default level of 6 is used. Ifoutput
is provided, the compressed data will be written to that OutputStream, otherwise the compressed data will be accessed from thegetBytes
method.
Properties
- crc32 ↔ int
-
The computed CRC32 checksum of the uncompressed data.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- total ↔ int
-
Read a buffer from the current input stream, update the adler32
and total number of bytes read. All deflate() input goes through
this function so some applications may wish to modify it to avoid
allocating a large strm->next_in buffer and copying from it.
(See also flush_pending()).
getter/setter pair
Methods
-
biFlush(
) → void - Flush the bit buffer, keeping at most 7 bits in it.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setDataType(
) → void - Set the data type to ASCII or BINARY, using a crude approximation: binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. IN assertion: the fields freq of dyn_ltree are set and the total of all frequencies does not exceed 64K (to fit in an int on 16 bit machines).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- blCodes → const int
- blockDone → const int
- block flush performed
- bufferSize → const int
- busyState → const int
- dCodes → const int
- defMemLevel → const int
- dynamicTrees → const int
- endBlock → const int
- fast → const int
- finishDone → const int
- finish done, accept no more input or output
- finishStarted → const int
- finish started, need only more output at next deflate
- finishState → const int
- heapSize → const int
- initState → const int
- lCodes → const int
- lengthCodes → const int
- literals → const int
- maxBits → const int
- maxMatch → const int
- maxMemLevel → const int
- maxWindowBits → const int
- 32K LZ77 window
- minLookAhead → const int
- minMatch → const int
- needMore → const int
- block not completed, need more input or more output
- rep3_6 → const int
- repeat previous bit length 3-6 times (2 bits of repeat count)
- repz3_10 → const int
- repeat a zero length 3-10 times (3 bits of repeat count)
- repz11_138 → const int
- repeat a zero length 11-138 times (7 bits of repeat count)
- slow → const int
- staticTrees → const int
- stored → const int
- storedBlock → const int
- zAscii → const int
- zBinary → const int
- zBufError → const int
- zDataError → const int
- zDefaultStrategy → const int
- zDeflated → const int
- The deflate compression method
- zErrNo → const int
- zFiltered → const int
- zHuffmanOnly → const int
- zMemError → const int
- zNeedDict → const int
- zOk → const int
- zStreamEnd → const int
- zStreamError → const int
- zUnknown → const int
- zVersionError → const int