Language Reference Guide : System Classes : StringObject Class : ConvertFromBinary Method
 
Share this page          
ConvertFromBinary Method
The ConvertFromBinary method loads the object from the binary contents of a LongByteObject. This provides a way of converting binary data into a text string.
This method has the following syntax:
integer = StringObject.ConvertFromBinary(binary = LongByteObject,
          format = integer [, base64_wrap = integer]);
This method has the following parameters:
binary
(Required) Specifies the LongByteObject
format
(Required) Specifies how the binary contents of the LongByteObject are converted into text. Valid settings are:
EF_HEX
Specifies that each byte is converted into a two-character hexadecimal representation of that byte. For example, the three bytes containing the values 0, 1, and 127 get copied into a string with a value of '00017F'. Using this format increases the size of the data by 100 percent.
EF_BASE64
Specifies that Base64 Content-Transfer-Encoding algorithm is used to convert binary data into a string. As an example, the three bytes containing the values 0, 1, 127 get copied into a string with a value of 'AAF/'. Using this format increases the size of data by about 33 percent.
Descriptions of system constant values and their numeric equivalents are listed in Encoding Format.
base64_wrap
Defines the number of characters in a BASE64-encoded string (format=EF_BASE64) after which a newline character is inserted so that lines wrap. Setting this parameter to 0 (zero) disables line wrapping.
Default: 76
This method returns ER_OK if successful. If invalid characters are found outside the alphabet of the specified format or if any other errors occur, the method returns ER_FAIL. Descriptions of system constant values and their numeric equivalents are listed in Error Codes.