<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Stream/PropertyKey",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@T@NSStreamPropertyKey"
  },
  "title" : "Stream.PropertyKey"
}
-->

# Stream.PropertyKey

`NSStream` defines these string constants as keys for accessing stream properties using [`property(forKey:)`](/documentation/Foundation/Stream/property(forKey:)) and setting properties with [`setProperty(_:forKey:)`](/documentation/Foundation/Stream/setProperty(_:forKey:)):

```
struct PropertyKey
```

## Topics

### Type Properties

[`NSStreamDataWrittenToMemoryStreamKey`](/documentation/Foundation/Stream/PropertyKey/dataWrittenToMemoryStreamKey)

Value is an `NSData` instance containing the data written to a memory stream.

[`NSStreamFileCurrentOffsetKey`](/documentation/Foundation/Stream/PropertyKey/fileCurrentOffsetKey)

Value is an `NSNumber` object containing the current absolute offset of the stream.

[`NSStreamNetworkServiceType`](/documentation/Foundation/Stream/PropertyKey/networkServiceType)

The type of service for the stream. Providing the service type allows the system to properly handle certain attributes of the stream, including routing and suspension behavior. Most streams do not need to set this property. See `Stream Service Types` for a list of possible values.

[`NSStreamSocketSecurityLevelKey`](/documentation/Foundation/Stream/PropertyKey/socketSecurityLevelKey)

[`NSStreamSOCKSProxyConfigurationKey`](/documentation/Foundation/Stream/PropertyKey/socksProxyConfigurationKey)

Value is an `NSDictionary` object containing SOCKS proxy configuration information.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

---

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)