"Sputnik" help  
Sputnik Help
NbtCompoundDecompress(<nbtCompound>)

Description

Decompresses a binary string containing a compressed NBT compound.

Parameters

<nbtCompound> The binary string representing the compressed NBT compound.

Return Value

Success: Returns the decompressed NBT compound as an NBT compound object.
Failure: Returns null if the provided compressedData parameter is not a valid compressed NBT compound or if the decompression fails.

Remarks

The NbtCompoundDecompress function allows you to decompress a binary string containing a compressed NBT compound. It performs the decompression using the appropriate decompression algorithm, such as GZip, to restore the original uncompressed NBT compound. If the provided compressedData parameter is not a valid compressed NBT compound or if the decompression process fails, the function returns null.

Related

Example

Example of usage:

NbtCompoundSet($nbt, "Cat", "Meow");
NbtCompoundSet($nbt, "Dog", "Woof");

my $data = NbtCompoundCompress($nbt);
say BinaryExpand($data);

unset($nbt);

my $nbt = NbtCompoundDecompress($data);

say $nbt;

foreach(my $key => my $value in NbtCompoundGetMap($nbt))
    say "[$key] = $value";

// PRINTS
// 00 | 4E 42 54 21 32 00 00 00 1F 8B 08 00 00 00 00 00 NBT!2...........
// 01 | 04 00 F3 73 0A 51 E4 62 60 60 60 76 4E 2C 01 52 ..ós.Qäb```vN,.R
// 02 | 2C BE A9 F9 E5 60 BE 4B 7E 3A 88 1F 9E 9F 9F C6 ,.©ùå`.K~:.....Æ
// 03 | 00 00 C9 B1 E7 AB 25 00 00 00 -- -- -- -- -- -- ..ɱç«%...
// {NBTTag;Compound::[Cat:Meow,Dog:Woof]}
// [Cat] = Meow
// [Dog] = Woof

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org