com.faunos.util.io
Class FilterOutputChannel

java.lang.Object
  extended by com.faunos.util.io.FilterOutputChannel
All Implemented Interfaces:
Closeable, Channel, GatheringByteChannel, WritableByteChannel
Direct Known Subclasses:
DebugOutputChannel

public class FilterOutputChannel
extends Object
implements GatheringByteChannel

A filter (or facade) on a GatheringByteChannel.

Author:
Babak Farhang

Field Summary
protected  GatheringByteChannel inner
          The instance delegated to.
 
Constructor Summary
protected FilterOutputChannel()
          Default constructor exposed to subclasses.
  FilterOutputChannel(GatheringByteChannel inner)
          Creates a new instance with the underlying inner instance.
 
Method Summary
 void close()
           
 boolean isOpen()
           
 int write(ByteBuffer src)
           
 long write(ByteBuffer[] srcs)
          Invokes write(srcs, 0, srcs.length).
 long write(ByteBuffer[] srcs, int offset, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inner

protected GatheringByteChannel inner
The instance delegated to. Must not be null after construction.

Constructor Detail

FilterOutputChannel

protected FilterOutputChannel()
Default constructor exposed to subclasses.

See Also:
inner

FilterOutputChannel

public FilterOutputChannel(GatheringByteChannel inner)
Creates a new instance with the underlying inner instance.

Method Detail

write

public long write(ByteBuffer[] srcs)
           throws IOException
Invokes write(srcs, 0, srcs.length).

Specified by:
write in interface GatheringByteChannel
Throws:
IOException

write

public long write(ByteBuffer[] srcs,
                  int offset,
                  int length)
           throws IOException
Specified by:
write in interface GatheringByteChannel
Throws:
IOException

write

public int write(ByteBuffer src)
          throws IOException
Specified by:
write in interface WritableByteChannel
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in interface Channel
Throws:
IOException

isOpen

public boolean isOpen()
Specified by:
isOpen in interface Channel


SourceForge.net Logo