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

# readInto:startingAt:length:error:

Synchronously reads data from the resource into a buffer.

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

## 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 method’s return value contains the actual number of bytes read.

`error`

On return, any error encountered while reading data, or `nil` if no error occurred.

## Return Value

The actual number of bytes read.

## Discussion

This is a synchronous version of [`readInto:startingAt:length:completionHandler:`](/documentation/FSKit/FSBlockDeviceResource/readInto:startingAt:length:completionHandler:).

> Note: In some cases, this method performs a partial read. In this case, the return value is shorter than the requested length, and the `error` is set to `nil`.

---

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)