1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
11 #define XZ_DEC_DYNALLOC
14 // Used to decode XZ stream buffers.
17 // Returns whether the provided buffer is likely a XZ stream.
18 static bool IsXZ(const void* aBuf
, size_t aBufSize
);
20 // Creates a XZ stream object for the given input buffer.
21 XZStream(const void* aInBuf
, size_t aInSize
);
24 // Initializes the decoder and returns whether decoding may commence.
26 // Decodes the next chunk of input into the given output buffer.
27 size_t Decode(void* aOutBuf
, size_t aOutSize
);
28 // Returns the number of yet undecoded bytes in the input buffer.
29 size_t RemainingInput() const;
30 // Returns the total number of bytes in the input buffer (compressed size).
32 // Returns the expected final number of bytes in the output buffer.
33 // Note: will return 0 before successful Init().
34 size_t UncompressedSize() const;
37 // Parses the stream footer and returns the size of the index in bytes.
38 size_t ParseIndexSize() const;
39 // Parses the stream index and returns the expected uncompressed size in
41 size_t ParseUncompressedSize() const;
43 const uint8_t* mInBuf
;