Click or drag to resize

StringConversionConvertToMaxLengthEncoded Method (String, Int32, Int32, Boolean)

Convert a string to an array of bytes, where the first 'lengthSize' bytes contain the maximum length of the string, and the next 'lengthSize' bytes contain the actual string length.

Namespace:  Demo3D.PLC
Assembly:  PLC (in PLC.dll) Version: 15.0.2.11458
Syntax
C#
public static byte[] ConvertToMaxLengthEncoded(
	string str,
	int lengthSize,
	int maxLength,
	bool bigEndian
)

Parameters

str
Type: SystemString
String to convert.
lengthSize
Type: SystemInt32
Number of bytes at the start of the byte array that encode the length of the string.
maxLength
Type: SystemInt32
Maximum length of the string.
bigEndian
Type: SystemBoolean
Encoding for 'length'.

Return Value

Type: Byte
Encoded array.
See Also