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

# read(into:)

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

## Declaration

```swift
func read(into buffer: UnsafeMutableRawBufferPointer) throws -> Int
```

## Parameters

- `buffer`: The data buffer that the operation fills with the read bytes.

## Return Value

Return Value The number of bytes read and stored by the stream.

## Discussion

Discussion This function increments the internal stream position by the number of bytes read by the stream.

## See Also

### Reading and Writing Data

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