> On May 19, 2016, at 12:58 AM, Quinn The Eskimo! via swift-users
> <swift-users@swift.org> wrote:
>
> The reason I ask is that most of the time when I mess around with files I
> transfer the entire file to and from memory, which is something that the
> Foundation APIs excel at.
I believe Mac/iOS developers usually transfer the entire file because that’s
the particular hammer that Foundation provides. For some reason Foundation has
never had good stream APIs (and they used to be worse!), so it’s much more
convenient to just use NSData or NSString methods to read and write the entire
file, than it is to mess around with NSFileHandle or NSStream.
Conversely, most other platforms (certainly C/POSIX and Java) make it easier to
stream the file (which I believe is more efficient; certainly more scalable)
than to block-read/write it.
I’m hoping that the Swift translation of Foundation provides greatly-improved
Stream classes.
—Jens
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users