---
title: "read(into:atOffset:)"
framework: applearchive
role: symbol
role_heading: Instance Method
path: "applearchive/archivebytestreamprotocol/read(into:atoffset:)"
---

# read(into:atOffset:)

Reads data at the supplied offset to the specified buffer, not exceeding the buffer’s previously allocated size.

## Declaration

```swift
func read(into buffer: UnsafeMutableRawBufferPointer, atOffset offset: Int64) throws -> Int
```

## Parameters

- `buffer`: The data buffer that the operation fills with the read bytes.
- `offset`: The stream position of the segment that the operation reads.

## Return Value

Return Value The number of bytes read by the stream.

## See Also

### Reading and Writing Data

- [read(into:)](applearchive/archivebytestreamprotocol/read(into:).md)
- [write(from:)](applearchive/archivebytestreamprotocol/write(from:).md)
- [write(from:atOffset:)](applearchive/archivebytestreamprotocol/write(from:atoffset:).md)
