<!--
{
  "availability" : [
    "macOS: 15.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSBlockDeviceResource/readInto:startingAt:length:completionHandler:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(cs)FSBlockDeviceResource(im)readInto:startingAt:length:completionHandler:"
  },
  "title" : "readInto:startingAt:length:completionHandler:"
}
-->

# readInto:startingAt:length:completionHandler:

Reads data from the resource into a buffer and executes a block afterwards.

```
- (void) readInto:(void *) buffer startingAt:(off_t) offset length:(size_t) length completionHandler:(void (^)(size_t actuallyRead, NSError *error)) completionHandler;
```

## Parameters

`buffer`

A buffer to receive the data.

`offset`

The offset into the resource from which to start reading.

`length`

A maximum number of bytes to read. The completion handler receives a parameter with the actual number of bytes read.

`completionHandler`

A block that executes after the read operation completes. If successful, the first parameter contains the number of bytes actually read. In the case of an error, the second parameter contains a non-`nil` error. This value is `EFAULT` if `buffer` is `NULL`, or `errno` if reading from the resource failed.

## Discussion

For the read to succeed, requests must conform to any transfer requirements of the underlying resource.
Disk drives typically require sector (`physicalBlockSize`) addressed operations of one or more sector-aligned offsets.

---

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)