Add your comments here...
I'm trying to use TArrayStream and it gives me a linker error.
Use MemoryStream instead. It has a constructor that takes a char even though I notice that isn't listed in the doc. I will send Walter a update for that.
The error using TArrayStream is probably due to building in debug mode but linking against a non-debug build of phobos. So I'll probably remove TArrayStream from the doc since it is a pain to work with (you must pass -release to dmd). Either that or dmd.zip needs to include debug and non-debug builds of phobos.
std.stream supports ungetc, which pushes a character back by maintaining an array of pushed-back characters. Right now only the text functions check this array for content, though. I think the idea was that if one is storing text and binary data mixed together that the text are stored with writeString which puts a length byte followed by the text.
You can probably use readf almost like scanf, there is one difference that you must note though. scanf returns EOF at the end of file, readf always returns 0 if it didn't read any elements.
Corresponding page in the D Specification