<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZVirtioQueueElement/readBuffers()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(cs)VZVirtioQueueElement(im)readBuffers"
  },
  "title" : "readBuffers()"
}
-->

# readBuffers()

Gets the remaining read buffers memory represented as an array of data.

```
func readBuffers() -> [Data]
```

## Return Value

An array of <doc://com.apple.documentation/documentation/Foundation/NSData> object that represents the remaining read buffers memory.

## Discussion

This method gets the remaining read buffers memory, after calling this method, [`readBuffersAvailableByteCount`](/documentation/Virtualization/VZVirtioQueueElement/readBuffersAvailableByteCount) will be zero,
behaving as if you have read all of the read buffers available in the [`VZVirtioQueueElement`](/documentation/Virtualization/VZVirtioQueueElement).

Here, the memory is represented as scatter-gather buffers directly referencing guest memory without any extra copy.

> Important: It’s strongly recommended to access the underlying memory only once. Accessing this memory multiple times can
> introduce time-of-check, time-of-use (TOCTOU) bugs which are prone to security attacks. Since the guest is free to modify its
> memory at any time, two consecutive reads may return different results, and malicious guests can take advantage of this to
> perform various attacks.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)