InputStream, FileInputStream in Standard Library?

I haven‘t found any InputStream type or protocol in the Swift Standard Library.

There is an InputStream.swift file but it contains just one function (readLine).
This is in contrast to OutputStream.swift which at least contains a TextOutputStream protocol.

Am I searching in the wrong places?

InputStream is a part of Foundation, not the standard library. You should be able to find the open-source version that’s used on non-Apple platforms on GitHub; Apple’s proprietary version that runs on its platforms is closed source.

1 Like