---
title: "read"
source: "https://browserpod.io/docs/reference/BinaryFile/read"
---

# read

Read raw bytes from a BinaryFile in a BrowserPod Pod, returning the requested length of data as an ArrayBuffer.

```ts
class BinaryFile {
  async read(length: number): Promise<ArrayBuffer>;
}
```

## Parameters

- **length (`int`)** - Length in bytes of the data to be read.

## Returns

`read` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which is resolved when the operation has succeeded. The promise resolves to an `ArrayBuffer` containing the data that was read. On success the seek position is updated. If there is an error during the read, the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) will be rejected.
