tango.io.stream.Snoop

License:

BSD style: see license.txt

Version:

Initial release: Oct 2007

Author:

Kris
class SnoopInput : InputStream
Stream to expose call behaviour. By default, activity trace is sent to Cerr.
this(InputStream host, Snoop snoop = null)
Attach to the provided stream.
InputStream input()
Return the upstream host of this filter.
IConduit conduit() [final]
Return the hosting conduit.
size_t read(void[] dst) [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.
void[] load(size_t max = -1)
Load the bits from a stream, and return them all in an array. The dst array can be provided as an option, which will be expanded as necessary to consume the input.
Returns an array representing the content, and throws IOException on error.
InputStream flush() [final]
Clear any buffered content.
void close() [final]
Close the input.
long seek(long offset, Anchor anchor = Begin) [final]
Seek on this stream. Target conduits that don't support seeking will throw an IOException.
class SnoopOutput : OutputStream
Stream to expose call behaviour. By default, activity trace is sent to Cerr.
this(OutputStream host, Snoop snoop = null)
Attach to the provided stream.
OutputStream output()
Return the upstream host of this filter.
size_t write(const(void)[] src) [final]
Write to conduit from a source array. The provided src content will be written to the conduit.
Returns the number of bytes written from src, which may be less than the quantity provided.
IConduit conduit() [final]
Return the hosting conduit.
OutputStream flush() [final]
Emit/purge buffered content.
void close() [final]
Close the output.
OutputStream copy(InputStream src, size_t max = -1) [final]
Transfer the content of another conduit to this one. Returns a reference to this class, or throws IOException on failure.
long seek(long offset, Anchor anchor = Begin) [final]
Seek on this stream. Target conduits that don't support seeking will throw an IOException.