---
title: readBytes
framework: kernel
role: pseudoSymbol
path: kernel/iodmacommand/1811301-readbytes
---

# readBytes

Copy data from the IODMACommand's buffer to the specified buffer.

## Declaration

```occ
UInt64 readBytes(
 UInt64offset,
 void *bytes,
 UInt64length); 
```

## Parameters

- `offset`: A byte offset into the IODMACommand's memory, relative to the prepared offset.
- `bytes`: The caller supplied buffer to copy the data to.
- `length`: The length of the data to copy.

## Return Value

Return Value The number of bytes copied, zero will be returned if the specified offset is beyond the prepared length of the IODMACommand.

## Overview

Overview This method copies data from the IODMACommand's memory at the given offset, to the caller's buffer. The IODMACommand must be prepared, and the offset is relative to the prepared offset.

## See Also

### Transferring Data

- [readBytes](kernel/iodmacommand/1547724-readbytes.md)
- [writeBytes](kernel/iodmacommand/1811341-writebytes.md)
- [writeBytes](kernel/iodmacommand/1547742-writebytes.md)
