com.faunos.util.test
Class DebugOutputChannel
java.lang.Object
com.faunos.util.io.FilterOutputChannel
com.faunos.util.test.DebugOutputChannel
- All Implemented Interfaces:
- Closeable, Channel, GatheringByteChannel, WritableByteChannel
public class DebugOutputChannel
- extends FilterOutputChannel
A filter on a GatheringByteChannel that echoes whatever is
written 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 written is echoed to this stream. By default, this
is set to std out.
- See Also:
setDebugStream(PrintStream)
DebugOutputChannel
protected DebugOutputChannel()
- See Also:
FilterOutputChannel.FilterOutputChannel()
DebugOutputChannel
public DebugOutputChannel(GatheringByteChannel 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
write
public int write(ByteBuffer src)
throws IOException
- Specified by:
write
in interface WritableByteChannel
- Overrides:
write
in class FilterOutputChannel
- Throws:
IOException
write
public long write(ByteBuffer[] srcs,
int offset,
int length)
throws IOException
- Specified by:
write
in interface GatheringByteChannel
- Overrides:
write
in class FilterOutputChannel
- Throws:
IOException