19 OF_ASSUME_NONNULL_BEGIN
21 #define OF_INFLATE_STREAM_BUFFER_SIZE 4096
31 #ifdef OF_INFLATE_STREAM_M
35 uint8_t _buffer[OF_INFLATE_STREAM_BUFFER_SIZE];
36 uint_fast16_t _bufferIndex, _bufferLength;
38 uint_fast8_t _bitIndex, _savedBitsLength;
39 uint_fast16_t _savedBits;
41 uint8_t *_slidingWindow;
42 uint_fast16_t _slidingWindowIndex, _slidingWindowMask;
44 OF_INFLATE_STREAM_BLOCK_HEADER,
45 OF_INFLATE_STREAM_UNCOMPRESSED_BLOCK_HEADER,
46 OF_INFLATE_STREAM_UNCOMPRESSED_BLOCK,
47 OF_INFLATE_STREAM_HUFFMAN_TREE,
48 OF_INFLATE_STREAM_HUFFMAN_BLOCK
52 uint_fast8_t position;
56 uint_fast16_t position, length;
59 struct huffman_tree *litLenTree, *distTree;
60 struct huffman_tree *codeLenTree, *treeIter;
62 uint_fast16_t receivedCount;
63 uint_fast8_t value, litLenCodesCount, distCodesCount;
64 uint_fast8_t codeLenCodesCount;
67 struct huffman_tree *litLenTree, *distTree, *treeIter;
69 OF_INFLATE_STREAM_WRITE_VALUE,
70 OF_INFLATE_STREAM_AWAIT_CODE,
71 OF_INFLATE_STREAM_AWAIT_LENGTH_EXTRA_BITS,
72 OF_INFLATE_STREAM_AWAIT_DISTANCE,
73 OF_INFLATE_STREAM_AWAIT_DISTANCE_EXTRA_BITS,
74 OF_INFLATE_STREAM_PROCESS_PAIR
76 uint_fast16_t value, length, distance;
77 uint_fast16_t extraBits;
80 bool _inLastBlock, _atEndOfStream;
90 + (instancetype)streamWithStream: (
OFStream*)stream;
100 - initWithStream: (
OFStream*)stream;
103 OF_ASSUME_NONNULL_END
A base class for different types of streams.
Definition: OFStream.h:86
A class that handles Deflate decompression transparently for an underlying stream.
Definition: OFInflateStream.h:29