tango.io.stream.Endian

License:

BSD style: see license.txt

Version:

Initial release: Nov 2007

Author:

Kris

Streams for swapping endian-order. The stream is treated as a set of same-sized elements. Note that partial elements are not mutated

class EndianInput(T) : InputFilter, InputFilter.Mutator #
Type T is the element type
this(InputStream stream) #
size_t read(void[] dst) [override, final] #
Read from conduit into a target array. The provided dst will be populated with content from the conduit.
Returns the number of bytes read, which may be less than requested in dst (or IOStream.Eof for end-of-flow). Note that a trailing partial element will be placed into dst, but the returned length will effectively ignore it
class EndianOutput(T) : OutputFilter, OutputFilter.Mutator #
Type T is the element type
this(OutputStream stream) #
size_t write(void[] src) [override, final] #
Write to output stream from a source array. The provided src content will be consumed and left intact.
Returns the number of bytes written from src, which may be less than the quantity provided. Note that any partial elements will not be consumed