# ReturnBytes
{: .no_toc }

Returns the raw byte array loaded from the resource file.

Syntax: *object*.**ReturnBytes**() **As Byte()**

Returns a **Byte()** containing every byte of the resource data loaded by the preceding [**Read**](/tB/Packages/Contributed/TBMANLIB_RES/cRes/Read.md) call. If **Read** has not been called, the returned array is unallocated and has no elements.


### Remarks

**ReturnBytes** is the lowest-level retrieval method on **cRes**. The other retrieval methods---[**ReturnString**](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnString.md), [**ReturnHex**](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnHex.md), [**ReturnBase64**](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnBase64.md), and [**ReturnPicture**](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnPicture.md)---all derive their output from the same internal byte array that **ReturnBytes** exposes directly.

The returned array is a copy of the internal storage; modifying it does not affect the **cRes** instance.


### Example

This example loads a binary resource and writes it to a file.

```tb check_build
Dim res As New cRes
res.Read "MyData", "BINARY"

Dim b() As Byte
b = res.ReturnBytes()

Dim fileNum As Integer
fileNum = FreeFile()
Open "C:\output\data.bin" For Binary Access Write As #fileNum
Put #fileNum, , b
Close #fileNum
```

### See Also

- [Read](/tB/Packages/Contributed/TBMANLIB_RES/cRes/Read.md) method
- [ReturnString](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnString.md) method
- [ReturnHex](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnHex.md) method
- [ReturnBase64](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnBase64.md) method
- [ReturnPicture](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnPicture.md) method
