Click or drag to resize

StringConversionConvertFromLengthEncoded Method (Byte, Int32, Int32, Int32, Boolean, Int32, StringConversionGetString)

Convert an array of bytes, where the first 'lengthSize' bytes contains the string length (in bytes).

Namespace:  Demo3D.PLC
Assembly:  PLC (in PLC.dll) Version: 15.0.2.11458
Syntax
C#
public static string ConvertFromLengthEncoded(
	byte[] bytes,
	int index,
	int numBytes,
	int lengthSize,
	bool bigEndian,
	out int length,
	StringConversionGetString encoding
)

Parameters

bytes
Type: SystemByte
Array of bytes to decode.
index
Type: SystemInt32
Index of first encoded byte in array (first 'length' byte).
numBytes
Type: SystemInt32
Maximum number of bytes to decode (or -1).
lengthSize
Type: SystemInt32
Number of bytes at the start that denote the length of the string.
bigEndian
Type: SystemBoolean
Encoding for 'length'.
length
Type: SystemInt32
Length of string buffer decoded.
encoding
Type: Demo3D.PLCStringConversionGetString
String converter.

Return Value

Type: String
String representation.
See Also