View source code
Display the source code in std/zlib.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Function std.zlib.UnCompress.empty
Returns true if all input data has been decompressed and no further data can be decompressed (inflate() returned Z_STREAM_END)
bool empty() @property const;
Example
// some random data
ubyte[1024] originalData = void;
// append garbage data (or don't, this works in both cases)
auto compressedData = cast(ubyte[]) compress(originalData) ~ cast(ubyte[]) "whatever";
auto decompressor = new UnCompress();
auto uncompressedData = decompressor .uncompress(compressedData);
assert(uncompressedData[] == originalData[],
"The uncompressed and the original data differ");
assert(decompressor .empty, "The UnCompressor reports not being done");
}
Authors
License
Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.