|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.limewire.nio.channel.AbstractBufferChannelWriter
public abstract class AbstractBufferChannelWriter
A simple channel that buffers data in a ByteBuffer.
| Field Summary | |
|---|---|
protected ByteBuffer |
buffer
|
protected InterestWritableByteChannel |
channel
The sink channel we write to & interest ourselves on. |
protected boolean |
shutdown
|
| Constructor Summary | |
|---|---|
AbstractBufferChannelWriter(int bufferSize)
|
|
| Method Summary | |
|---|---|
InterestWritableByteChannel |
getWriteChannel()
The channel we're writing to. |
void |
handleIOException(IOException iox)
Does nothing. |
boolean |
handleWrite()
Writes as many messages as possible to the sink. |
void |
put(byte[] data)
Adds data to the buffer and signals interest in writing to
the channel. |
void |
setWriteChannel(InterestWritableByteChannel channel)
The channel we're writing to. |
void |
shutdown()
Releases any resources used by this component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected InterestWritableByteChannel channel
protected ByteBuffer buffer
protected volatile boolean shutdown
| Constructor Detail |
|---|
public AbstractBufferChannelWriter(int bufferSize)
| Method Detail |
|---|
public InterestWritableByteChannel getWriteChannel()
getWriteChannel in interface ChannelWriterpublic void setWriteChannel(InterestWritableByteChannel channel)
setWriteChannel in interface ChannelWriter
public void put(byte[] data)
throws IOException
data to the buffer and signals interest in writing to
the channel.
IOException - If the channel is already shutdown
BufferOverflowException - If there is insufficient space in the buffer
public boolean handleWrite()
throws IOException
handleWrite in interface WriteObservertrue there is still data to be written, otherwise
false.
IOExceptionpublic void handleIOException(IOException iox)
handleIOException in interface IOErrorObserverpublic void shutdown()
Shutdownable
shutdown must never throw any exceptions.
shutdown in interface Shutdownable
|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||