<!--
{
  "availability" : [
    "iOS: 2.0.0 - 27.0.0",
    "iPadOS: 2.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.2.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NetService/getInputStream(_:outputStream:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSNetService(im)getInputStream:outputStream:"
  },
  "title" : "getInputStream(_:outputStream:)"
}
-->

# getInputStream(_:outputStream:)

Creates a pair of input and output streams for the receiver and returns a Boolean value that indicates whether they were retrieved successfully.

```
func getInputStream(_ inputStream: UnsafeMutablePointer<InputStream?>?, outputStream: UnsafeMutablePointer<OutputStream?>?) -> Bool
```

## Parameters

`inputStream`

Upon return, the input stream for the receiver. Pass `NULL` if you do not need this stream.

`outputStream`

Upon return, the output stream for the receiver. Pass `NULL` if you do not need this stream.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the streams are created successfully, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

After this method is called, no delegate callbacks are called by the receiver.

> Note:
> If automatic reference counting is not used, the input and output streams returned through the parameters are *retained*, which means that you are responsible for releasing them to avoid memory leaks.

---

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)