---
title: "readBytes(withExactLength:)"
framework: virtualization
role: symbol
role_heading: Instance Method
path: "virtualization/vzvirtioqueueelement/readbytes(withexactlength:)"
---

# readBytes(withExactLength:)

Reads the number of bytes you specify from the read buffers and return result as a data object.

## Declaration

```swift
func readBytes(withExactLength exactLength: Int) throws -> Data
```

## Parameters

- `exactLength`: Number of bytes to read from the read buffers.

## Return Value

Return Value An NSData object filled with the memory that the framework read, or nil if the read failed.

## Discussion

Discussion Memory is copied into the newly allocated buffer represented by the returned NSData object.
