<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppleArchive",
  "identifier" : "/documentation/AppleArchive/ArchiveByteStreamProtocol/read(into:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Apple Archive"
    ],
    "preciseIdentifier" : "s:12AppleArchive0B18ByteStreamProtocolP4read4intoSiSw_tKF"
  },
  "title" : "read(into:)"
}
-->

# read(into:)

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

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

## Parameters

`buffer`

The data buffer that the operation fills with the read bytes.

## Return Value

The number of bytes read and stored by the stream.

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)