---
title: "getInputStream(_:outputStream:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/netservice/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.

## Declaration

```swift
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

Return Value true if the streams are created successfully, otherwise false.

## Discussion

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.

## See Also

### Configuring Network Services

- [data(fromTXTRecord:)](foundation/netservice/data(fromtxtrecord:).md)
- [dictionary(fromTXTRecord:)](foundation/netservice/dictionary(fromtxtrecord:).md)
- [addresses](foundation/netservice/addresses.md)
- [domain](foundation/netservice/domain.md)
- [includesPeerToPeer](foundation/netservice/includespeertopeer.md)
- [name](foundation/netservice/name.md)
- [type](foundation/netservice/type.md)
- [txtRecordData()](foundation/netservice/txtrecorddata().md)
- [setTXTRecord(_:)](foundation/netservice/settxtrecord(_:).md)
- [delegate](foundation/netservice/delegate.md)
