---
title: "process(readingFrom:writingTo:selectUsing:flags:threadCount:)"
framework: applearchive
role: symbol
role_heading: Type Method
path: "applearchive/archivestream/process(readingfrom:writingto:selectusing:flags:threadcount:)"
---

# process(readingFrom:writingTo:selectUsing:flags:threadCount:)

Processes archive elements between two archive streams.

## Declaration

```swift
static func process(readingFrom input: ArchiveStream, writingTo output: ArchiveStream, selectUsing filter: ArchiveHeader.EntryFilter? = nil, flags: ArchiveFlags = [], threadCount: Int = 0) throws -> Int
```

## Parameters

- `input`: The input stream.
- `output`: The output stream.
- `filter`: A closure that’s called for each entry that’s received by the stream.
- `flags`: Flags that control the behavior of the operation.
- `threadCount`: The number of worker threads that the operation uses, set to 0 for default.

## Return Value

Return Value The number of processed bytes.
