<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Compression",
  "identifier" : "/documentation/Compression/compression_stream/init(dst_ptr:dst_size:src_ptr:src_size:state:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Compression"
    ],
    "preciseIdentifier" : "s:So18compression_streama7dst_ptr0C5_size04src_D00f1_E05stateABSpys5UInt8VG_SiSPyAIGSiSvSgtcfc"
  },
  "title" : "init(dst_ptr:dst_size:src_ptr:src_size:state:)"
}
-->

# init(dst_ptr:dst_size:src_ptr:src_size:state:)

Returns a new compression stream structure.

```
init(dst_ptr: UnsafeMutablePointer<UInt8>, dst_size: Int, src_ptr: UnsafePointer<UInt8>, src_size: Int, state: UnsafeMutableRawPointer?)
```

## Parameters

`dst_ptr`

A pointer to the first byte of the destination buffer.

`dst_size`

The size, in bytes, on the destination buffer.

`src_ptr`

A pointer to the first byte of the source buffer.

`src_size`

The size, in bytes, on the source buffer.

`state`

The stream state object of the compression stream. You should not directly access this field.

---

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)