std.stream.EndianStream ...

torhu fake at address.dude
Thu Feb 8 17:01:22 PST 2007


nescire wrote:
> It seemed to me that EndianStream was supposed to wrap a source stream to provide byte swapping on multi-byte read/write. I don't think the rest of FilterStream's functionality should be affected.
> The stream itself doesn't necesserily contain multi-byte data only, e.g. it can contain flag bytes, followed by multi-byte data (which is what I wanted to use EndianStream for).

According to the docs for EndianStream, it should be safe to do this:

auto stream = new EndianStream(source);
ubyte flags;

stream.source.read(flags);  // call source stream's read() directly

> 
> And by the way, thanks for the help!

You're welcome.


More information about the Digitalmars-d-learn mailing list