I've got a few suggestions to make std.stream more convenient (and in one case just the documentation more clear). See my NG post [1] for details, I'll just summarize it here: * The documentation claims write( <basic type> ) is implementation specific - this is not true for most types - it's actually platform specific and with the EndianStream most read/write operations can safely be used between different platforms. Especially for the SocketStream this is good to know. * InputStream's read( <type> val ) sometimes is inconvenient, please add something like T read(T)() { T ret; readExact(&ret, ret.sizeof); return ret; } So one can use "myFun( s.read!float );" instead of "float x; s.read(x); myFun(x);" * Minor inconsistencies: add readExact(ubyte[] buf) to Inputstream, because there is a read(ubyte[] buf) and add writeExact(ubyte[] buf) to OutputStream because there is write(ubyte[] buf). * For convenience ubyte[] readExact(size_t len) might be nice. Thanks, - Daniel [1] http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=118413 - my NG post on these matters (and also on bug 5001)
I thought std.stream is deprecated. Maybe "someone" could confirm and close this as invalid.
It will probably be deprecated, but at this time it isn't (there is no alternative yet, anyway). However I just realized that my idea for read() can't be implemented *that* easy because it wouldn't work properly with EndianStream. For that to work one would have to check whether T is a simple type (int, float, double, long, etc) and in that case call fixBO() in EndianStream (like the available, inconvenient read(<basic type>) methods in EndianStream already do). Or do it old school and provide readInt(), readUInt(), readLong(), readUlong(), readFloat() etc instead of using a template.
std.stream is deprecated and will be removed in 2016