com.faunos.util.test
Class DebugInputChannel
java.lang.Object
com.faunos.util.io.FilterInputChannel
com.faunos.util.test.DebugInputChannel
- All Implemented Interfaces:
- Closeable, Channel, ReadableByteChannel, ScatteringByteChannel
public class DebugInputChannel
- extends FilterInputChannel
A filter on a ScatteringByteChannel that echoes whatever is
read to a PrintStream. The data is assumed to be ASCII;
non-ASCII bytes are echoed as %[hex value].
- Author:
- Babak Farhang
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
debugOut
protected PrintStream debugOut
- What was just read is echoed to this stream. By default, this
is set to std out.
- See Also:
setDebugStream(PrintStream)
DebugInputChannel
protected DebugInputChannel()
- See Also:
FilterInputChannel.FilterInputChannel()
DebugInputChannel
public DebugInputChannel(ScatteringByteChannel inner)
- Creates a new instance.
setDebugStream
public void setDebugStream(PrintStream debugOut)
- Sets the debug PrintStream. By default, this
is set to std out.
- See Also:
debugOut
read
public int read(ByteBuffer dst)
throws IOException
- Specified by:
read
in interface ReadableByteChannel
- Overrides:
read
in class FilterInputChannel
- Throws:
IOException
read
public long read(ByteBuffer[] dsts,
int offset,
int length)
throws IOException
- Specified by:
read
in interface ScatteringByteChannel
- Overrides:
read
in class FilterInputChannel
- Throws:
IOException