---
title: "handleInboundData(from:readBytesStartOffset:readBytes:)"
framework: networkextension
role: symbol
role_heading: Instance Method
path: "networkextension/nefilterdataprovider/handleinbounddata(from:readbytesstartoffset:readbytes:)"
---

# handleInboundData(from:readBytesStartOffset:readBytes:)

Make a filtering decision about a chunk of inbound data.

## Declaration

```swift
func handleInboundData(from flow: NEFilterFlow, readBytesStartOffset offset: Int, readBytes: Data) -> NEFilterDataVerdict
```

## Parameters

- `flow`: An doc://com.apple.networkextension/documentation/NetworkExtension/NEFilterFlow object containing information about the flow.
- `offset`: An unsigned integer containing the offset of the data stored in readBytes. This offset is measured from the beginning of the flow’s inbound data.
- `readBytes`: An doc://com.apple.documentation/documentation/Foundation/NSData object containing the data to filter. For non-UDP/TCP flows, since the data may optionally include the IP header, readBytes includes a 4-byte doc://com.apple.networkextension/documentation/NetworkExtension/NEFilterDataAttribute field preceding the user data. Your handler must examine the doc://com.apple.networkextension/documentation/NetworkExtension/NEFilterDataAttribute field and handle the data accordingly.

## Return Value

Return Value A NEFilterDataVerdict object indicating how the system should handle the chunk of data and all subsequent inbound data for the flow.

## Discussion

Discussion NEFilterDataProvider subclasses must override this method.

## See Also

### Filtering network content

- [handleNewFlow(_:)](networkextension/nefilterdataprovider/handlenewflow(_:).md)
- [NEFilterDataAttribute](networkextension/nefilterdataattribute.md)
- [handleOutboundData(from:readBytesStartOffset:readBytes:)](networkextension/nefilterdataprovider/handleoutbounddata(from:readbytesstartoffset:readbytes:).md)
- [handleInboundDataComplete(for:)](networkextension/nefilterdataprovider/handleinbounddatacomplete(for:).md)
- [handleOutboundDataComplete(for:)](networkextension/nefilterdataprovider/handleoutbounddatacomplete(for:).md)
