tango.io.stream.Snoop

License:
BSD style:

Version:
Initial release: Oct 2007

author:
Kris

class SnoopInput: tango.io.model.IConduit.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.

final IConduit conduit();
Return the hosting conduit.

final size_t read(void[] dst);
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.

final InputStream flush();
Clear any buffered content.

final void close();
Close the input.

final long seek(long offset, Anchor anchor = Anchor.Begin);
Seek on this stream. Target conduits that don't support seeking will throw an IOException.

class SnoopOutput: tango.io.model.IConduit.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.

final size_t write(const(void)[] src);
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.

final IConduit conduit();
Return the hosting conduit.

final OutputStream flush();
Emit/purge buffered content.

final void close();
Close the output.

final OutputStream copy(InputStream src, size_t max = -1);
Transfer the content of another conduit to this one. Returns a reference to this class, or throws IOException on failure.

final long seek(long offset, Anchor anchor = Anchor.Begin);
Seek on this stream. Target conduits that don't support seeking will throw an IOException.


Page generated by Ddoc. Copyright (c) 2007 Kris Bell. All rights reserved