---
title: DispatchIO
framework: dispatch
role: symbol
role_heading: Class
path: dispatch/dispatchio
---

# DispatchIO

An object that manages operations on a file descriptor using either stream-based or random-access semantics.

## Declaration

```swift
class DispatchIO
```

## Topics

### Creating a Dispatch I/O Object

- [init(type:fileDescriptor:queue:cleanupHandler:)](dispatch/dispatchio/init(type:filedescriptor:queue:cleanuphandler:).md)
- [init(type:path:oflag:mode:queue:cleanupHandler:)](dispatch/dispatchio/init(type:path:oflag:mode:queue:cleanuphandler:)-50rb0.md)
- [init(type:io:queue:cleanupHandler:)](dispatch/dispatchio/init(type:io:queue:cleanuphandler:).md)
- [DispatchIO.StreamType](dispatch/dispatchio/streamtype.md)

### Reading from the File

- [read(offset:length:queue:ioHandler:)](dispatch/dispatchio/read(offset:length:queue:iohandler:).md)
- [read(fromFileDescriptor:maxLength:runningHandlerOn:handler:)](dispatch/dispatchio/read(fromfiledescriptor:maxlength:runninghandleron:handler:).md)

### Writing to the File

- [write(offset:data:queue:ioHandler:)](dispatch/dispatchio/write(offset:data:queue:iohandler:).md)
- [write(toFileDescriptor:data:runningHandlerOn:handler:)](dispatch/dispatchio/write(tofiledescriptor:data:runninghandleron:handler:).md)

### Closing the File

- [close(flags:)](dispatch/dispatchio/close(flags:).md)
- [DispatchIO.CloseFlags](dispatch/dispatchio/closeflags.md)

### Managing the File Descriptor

- [fileDescriptor](dispatch/dispatchio/filedescriptor.md)
- [setLimit(highWater:)](dispatch/dispatchio/setlimit(highwater:).md)
- [setLimit(lowWater:)](dispatch/dispatchio/setlimit(lowwater:).md)
- [setInterval(interval:flags:)](dispatch/dispatchio/setinterval(interval:flags:).md)
- [DispatchIO.IntervalFlags](dispatch/dispatchio/intervalflags.md)

### Synchronizing File Operations

- [barrier(execute:)](dispatch/dispatchio/barrier(execute:).md)

### Initializers

- [init(type:path:oflag:mode:queue:cleanupHandler:)](dispatch/dispatchio/init(type:path:oflag:mode:queue:cleanuphandler:)-25rlb.md)

## Relationships

### Inherits From

- [DispatchObject](dispatch/dispatchobject.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### System Event Monitoring

- [DispatchSource](dispatch/dispatchsource.md)
- [Dispatch Source](dispatch/dispatch-source.md)
- [DispatchData](dispatch/dispatchdata.md)
- [DispatchDataIterator](dispatch/dispatchdataiterator.md)
- [Dispatch I/O](dispatch/dispatch-i-o.md)
- [Dispatch Data](dispatch/dispatch-data.md)
- [DispatchSourceProtocol](dispatch/dispatchsourceprotocol.md)
