de.unkrig.commons.io
Class FileBufferedChannel

java.lang.Object
  extended by de.unkrig.commons.io.FileBufferedChannel
All Implemented Interfaces:
java.io.Closeable, java.nio.channels.Channel, java.nio.channels.WritableByteChannel

public class FileBufferedChannel
extends java.lang.Object
implements java.nio.channels.WritableByteChannel

A WritableByteChannel which forwards the data to a delegate. The FileBufferedChannel will never block because when the delegate is not writable, the data is buffered in a temporary file.


Constructor Summary
FileBufferedChannel(Multiplexer multiplexer, java.nio.channels.SelectableChannel delegate)
           
 
Method Summary
 void close()
           
 boolean isOpen()
           
 long transferFrom(java.nio.channels.ReadableByteChannel src, long count)
          ???
 int write(java.nio.ByteBuffer src)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBufferedChannel

public FileBufferedChannel(Multiplexer multiplexer,
                           java.nio.channels.SelectableChannel delegate)
                    throws java.io.IOException
Parameters:
delegate - Must also be a WritableByteChannel
Throws:
java.io.IOException
Method Detail

write

public int write(java.nio.ByteBuffer src)
          throws java.io.IOException
Specified by:
write in interface java.nio.channels.WritableByteChannel
Throws:
java.io.IOException

isOpen

public boolean isOpen()
Specified by:
isOpen in interface java.nio.channels.Channel

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in interface java.nio.channels.Channel
Throws:
java.io.IOException

transferFrom

public long transferFrom(java.nio.channels.ReadableByteChannel src,
                         long count)
                  throws java.io.IOException
???

Throws:
java.io.IOException