Core Function BinaryUncompress
From Sputnik Wiki
(Difference between revisions)
(Created page with "<pre> BinaryUncompress( <binary-array> ) </pre> === Description === Uncompress a binary variable data === Parameters === ==== binary-array ==== The binary variable to uncomp...") |
m (1 revision) |
||
(2 intermediate revisions by one user not shown) | |||
Line 26: | Line 26: | ||
<syntaxhighlight lang="sputnik"> | <syntaxhighlight lang="sputnik"> | ||
− | $binary = Pack(" | + | $binary = Pack("A*", ("Hello World!\n" x 1000)); |
− | println("Size uncompressed : " . BinaryLen($binary)) | + | println("Size uncompressed : " . BinaryLen($binary)); |
− | BinaryCompress($binary) | + | BinaryCompress($binary); |
− | println("Size compressed : " . BinaryLen($binary)) | + | println("Size compressed : " . BinaryLen($binary)); |
− | BinaryUncompress($binary) | + | BinaryUncompress($binary); |
− | println("Size uncompressed (again) : " . BinaryLen($binary)) | + | println("Size uncompressed (again) : " . BinaryLen($binary)); |
− | inputC("\nPress any key to see whats inside the binary variable after compress and decompress") | + | inputC("\nPress any key to see whats inside the binary variable after compress and decompress"); |
− | println( Unpack(" | + | println( Unpack("A*", $binary, 3) ); # Prints "Hello World!" 1000 times |
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Core Function]] | [[Category:Core Function]] |
Latest revision as of 12:38, 14 June 2015
BinaryUncompress( <binary-array> )
Contents |
Description
Uncompress a binary variable data
Parameters
binary-array
The binary variable to uncompress.
Return Value
Success: Returns 1.
Failure: Returns 0.
Remarks
None
Example
$binary = Pack("A*", ("Hello World!\n" x 1000)); println("Size uncompressed : " . BinaryLen($binary)); BinaryCompress($binary); println("Size compressed : " . BinaryLen($binary)); BinaryUncompress($binary); println("Size uncompressed (again) : " . BinaryLen($binary)); inputC("\nPress any key to see whats inside the binary variable after compress and decompress"); println( Unpack("A*", $binary, 3) ); # Prints "Hello World!" 1000 times