<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSVolume/ReadWriteHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(pl)FSVolumeReadWriteHandler"
  },
  "title" : "FSVolume.ReadWriteHandler"
}
-->

# FSVolume.ReadWriteHandler

Methods implemented for read and write operations that deliver data to and from the extension.

```
protocol ReadWriteHandler : NSObjectProtocol
```

## Overview

Most volumes conform to either this protocol or [`FSVolume.KernelOffloadedIOHandler`](/documentation/FSKit/FSVolume/KernelOffloadedIOHandler).
You can conform to both if you need to provide kernel-offloaded I/O only for certain files.
In that case, files with the [`inhibitKernelOffloadedIO`](/documentation/FSKit/FSItem/Attribute/inhibitKernelOffloadedIO) attribute set use this protocol, and those without it use [`FSVolume.KernelOffloadedIOHandler`](/documentation/FSKit/FSVolume/KernelOffloadedIOHandler).
A volume that doesn’t conform to either protocol can’t support any I/O operation.

> Important: This protocol replaces the ``doc://FSKit/documentation/FSKit/FSVolume/ReadWriteOperations`` protocol. It exposes the same functionality, while using ``doc://FSKit/documentation/FSKit/FSVolumeHandlerResult`` objects. These objects add the ability to reply with ``doc://FSKit/documentation/FSKit/FSItem/Attributes`` and free space from the relevant methods.

## Topics

### Reading and writing

[`-  readFromFile:offset:length:intoBuffer:replyHandler:`](/documentation/FSKit/FSVolume/ReadWriteHandler/read(from:at:length:into:replyHandler:))

Reads the contents of the given file item.

[`FSMutableFileDataBuffer`](/documentation/FSKit/FSMutableFileDataBuffer)

A wrapper object for a data buffer.

[`FSReadFileResult`](/documentation/FSKit/FSReadFileResult)

The result of a read-file call.

[`-  writeContents:toFile:atOffset:replyHandler:`](/documentation/FSKit/FSVolume/ReadWriteHandler/write(contents:to:at:replyHandler:))

Writes contents to the given file item.

[`FSWriteFileResult`](/documentation/FSKit/FSWriteFileResult)

The result of a read-file call.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)