The NSOutputStream class is a subclass of NSStream that provides write-only stream functionality.
The solution of this question no longer works with Swift 3. There is no longer a property bytes of Data (formerly …
swift nsdata foundation swift3 nsoutputstream