xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_GetLen8()

Retrieves the length of data in a serialized binary string.

Syntax

HB_GetLen8( <cBinaryData> ) --> nBytes

Arguments

<cBinaryData>
This is a character string obtained from one or multiple calls to HB_Serialize(). It holds the binary data of one ore more previously serialized variable(s).

Return

The function extracts the eight bytes encoding the length of binary data to read from a serialized binary character string and returns it as a numeric value.

Description

HB_GetLen8() is a utility function used in xHarbour's serialization system. It reads eight bytes previously encoded with HB_CreateLen8() and determines the length of the subsequent serialized character string that must be deserialized to obtain the original data.

Note:  the first byte of a serialized string contains a single letter encoding the data type (the letter is Valtype() compliant). The next eight bytes are the length of the binary data, and the rest is the binary data.

Refer to the file source\rtl\hbserial.prg for a usage example of HB_GetLen8().

Info

See also:HB_CreateLen8(), HB_Deserialize(), HB_Serialize()
Category: Serialization functions , xHarbour extensions
Source:rtl\hbsrlraw.c, rtl\hbserial.prg
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe