# 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  | <p>bytes \[System.Byte\[]] – The raw byte array containing a textual value.</p><p>codepage \[System.String] – The code page the byte array is currently encoded in. Default is UTF-8.</p> |

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/0%20\(2\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png)

**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)

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/1%20\(2\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png)

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.

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/2%20\(2\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png)
