## ToBytes() {#tobytes}

Converts the stream data to the Byte array.

```csharp
public virtual byte[] ToBytes()
```

### Return Value

The stream data converted to the Byte array.

### See Also

* class [StreamContainer](../)
* namespace [Aspose.Imaging](../../streamcontainer/)
* assembly [Aspose.Imaging](../../../)

---

## ToBytes(long, long) {#tobytes_1}

Converts the stream data to the Byte array.

```csharp
public virtual byte[] ToBytes(long position, long bytesCount)
```

| Parameter | Type | Description |
| --- | --- | --- |
| position | Int64 | The position to start reading bytes from. |
| bytesCount | Int64 | The bytes count to read. |

### Return Value

The stream data converted to the Byte array.

### See Also

* class [StreamContainer](../)
* namespace [Aspose.Imaging](../../streamcontainer/)
* assembly [Aspose.Imaging](../../../)


