23 lines
554 B
Plaintext
23 lines
554 B
Plaintext
:sig
|
|
String gz_uncompress(String compressed)
|
|
|
|
:params
|
|
compressed : gzip-format compressed bytes
|
|
return value : uncompressed bytes
|
|
|
|
:see
|
|
>sys
|
|
gz_compress
|
|
zip_list
|
|
zip_extract
|
|
|
|
:content
|
|
Uncompresses a gzip-format byte string and returns the original content.
|
|
|
|
```uce
|
|
String compressed = file_get_contents("/tmp/hello.txt.gz");
|
|
String plain = gz_uncompress(compressed);
|
|
```
|
|
|
|
`gz_uncompress()` validates the gzip header, CRC32 footer, and uncompressed-size footer. It throws a runtime error when the input is not a supported gzip stream or fails validation.
|