FromBytes

Name

FromBytes

Syntax

FromBytes (ByteArray bytes. String codePage)

Purpose

To return a string by reading a byte array in a specified encoding.

Description

Returns a string after it has been converted from a byte array.

Return Type

String

Parameters

bytes [System.Byte[]] – The raw byte array containing a textual value.

codepage [System.String] – The code page the byte array is currently encoded in. Default is UTF-8.

Example

In this example, we are passing the required parameters to the function transformation object using a Variables object and a ToByte object.

Where,

bytes = value

Note: The Value is the output value (bytes) from the ToBytes function transformation object, where a string value, “Hello World”, has been converted into a byte array.

codepage = 65001 (UTF-8 - Default)

Right-click on the FromBytes function transformation object and select Preview Output. You can see that Astera has returned a string value after successfully converting the provided byte array.

Last updated

© Copyright 2023, Astera Software