StringConversionConvertToMaxLengthEncoded Method (String, Int32, Int32, Boolean, Byte, Int32, Int32) |
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
Syntaxpublic static int ConvertToMaxLengthEncoded(
string str,
int lengthSize,
int maxLength,
bool bigEndian,
byte[] bytes,
int index,
int numBytes
)
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'. - bytes
- Type: SystemByte
Byte array to encode string into. - index
- Type: SystemInt32
Index into byte array of fist encoded byte (first byte of 'length'). - numBytes
- Type: SystemInt32
Maximum number of bytes in 'bytes' to encode string into.
Return Value
Type:
Int32Number of bytes encoded.
See Also