OpenMetaverse Protocol Library Developers API Documentation
ZeroDecode Method (src, srclen, dest)
NamespacesOpenMetaverseHelpersZeroDecode( array< Byte > [] () [] [] , Int32, array< Byte > [] () [] [] )
Decode a zerocoded byte array, used to decompress packets marked with the zerocoded flag
Declaration Syntax
C#
public 
static 
int 
ZeroDecode(
        
byte[] 
src,
        
int 
srclen,
        
byte[] 
dest
)
Parameters
src ( array< Byte > [] () [] [] )
The byte array to decode
srclen ( Int32)
The length of the byte array to decode. This would be the length of the packet up to (but not including) any appended ACKs
dest ( array< Byte > [] () [] [] )
The output byte array to decode to
Return Value
The length of the output buffer
Remarks
Any time a zero is encountered, the next byte is a count of how many zeroes to expand. One zero is encoded with 0x00 0x01, two zeroes is 0x00 0x02, three zeroes is 0x00 0x03, etc. The first four bytes are copied directly to the output buffer.

Assembly: OpenMetaverse(Module: OpenMetaverse.dll) Version: 0.9.3.3318 (0.9.3.3318)