public abstract class AbstractFramedStreamSourceChannel<C extends AbstractFramedChannel<C,R,S>,R extends AbstractFramedStreamSourceChannel<C,R,S>,S extends AbstractFramedStreamSinkChannel<C,R,S>> extends Object implements org.xnio.channels.StreamSourceChannel
Constructor and Description |
---|
AbstractFramedStreamSourceChannel(AbstractFramedChannel<C,R,S> framedChannel) |
AbstractFramedStreamSourceChannel(AbstractFramedChannel<C,R,S> framedChannel,
org.xnio.Pooled<ByteBuffer> data,
long frameDataRemaining) |
Modifier and Type | Method and Description |
---|---|
void |
awaitReadable() |
void |
awaitReadable(long l,
TimeUnit timeUnit) |
void |
close() |
protected void |
complete()
Method that is invoked when all data has been read.
|
org.xnio.ChannelListener.Setter<? extends R> |
getCloseSetter() |
protected AbstractFramedChannel<C,R,S> |
getFramedChannel() |
org.xnio.XnioIoThread |
getIoThread() |
<T> T |
getOption(org.xnio.Option<T> tOption) |
protected int |
getReadFrameCount() |
org.xnio.ChannelListener.Setter<? extends R> |
getReadSetter() |
org.xnio.XnioExecutor |
getReadThread() |
org.xnio.XnioWorker |
getWorker() |
protected void |
handleHeaderData(FrameHeaderData headerData) |
protected boolean |
isComplete() |
boolean |
isOpen() |
boolean |
isReadResumed() |
protected void |
lastFrame() |
int |
read(ByteBuffer dst) |
long |
read(ByteBuffer[] dsts) |
long |
read(ByteBuffer[] dsts,
int offset,
int length) |
void |
resumeReads() |
<T> T |
setOption(org.xnio.Option<T> tOption,
T t) |
void |
shutdownReads() |
boolean |
supportsOption(org.xnio.Option<?> option) |
void |
suspendReads() |
long |
transferTo(long count,
ByteBuffer throughBuffer,
org.xnio.channels.StreamSinkChannel streamSinkChannel) |
long |
transferTo(long position,
long count,
FileChannel target) |
void |
wakeupReads() |
public AbstractFramedStreamSourceChannel(AbstractFramedChannel<C,R,S> framedChannel)
public AbstractFramedStreamSourceChannel(AbstractFramedChannel<C,R,S> framedChannel, org.xnio.Pooled<ByteBuffer> data, long frameDataRemaining)
public long transferTo(long position, long count, FileChannel target) throws IOException
transferTo
in interface org.xnio.channels.StreamSourceChannel
IOException
public long transferTo(long count, ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel streamSinkChannel) throws IOException
transferTo
in interface org.xnio.channels.StreamSourceChannel
IOException
public void suspendReads()
suspendReads
in interface org.xnio.channels.SuspendableReadChannel
protected void complete() throws IOException
IOException
protected boolean isComplete()
public void resumeReads()
resumeReads
in interface org.xnio.channels.SuspendableReadChannel
public boolean isReadResumed()
isReadResumed
in interface org.xnio.channels.SuspendableReadChannel
public void wakeupReads()
wakeupReads
in interface org.xnio.channels.SuspendableReadChannel
public void shutdownReads() throws IOException
shutdownReads
in interface org.xnio.channels.SuspendableReadChannel
IOException
protected void lastFrame()
public void awaitReadable() throws IOException
awaitReadable
in interface org.xnio.channels.SuspendableReadChannel
IOException
public void awaitReadable(long l, TimeUnit timeUnit) throws IOException
awaitReadable
in interface org.xnio.channels.SuspendableReadChannel
IOException
protected void handleHeaderData(FrameHeaderData headerData)
public org.xnio.XnioExecutor getReadThread()
getReadThread
in interface org.xnio.channels.SuspendableReadChannel
public org.xnio.ChannelListener.Setter<? extends R> getReadSetter()
getReadSetter
in interface org.xnio.channels.StreamSourceChannel
getReadSetter
in interface org.xnio.channels.SuspendableReadChannel
public org.xnio.ChannelListener.Setter<? extends R> getCloseSetter()
getCloseSetter
in interface org.xnio.channels.CloseableChannel
getCloseSetter
in interface org.xnio.channels.StreamSourceChannel
getCloseSetter
in interface org.xnio.channels.SuspendableReadChannel
public org.xnio.XnioWorker getWorker()
getWorker
in interface org.xnio.channels.CloseableChannel
public org.xnio.XnioIoThread getIoThread()
getIoThread
in interface org.xnio.channels.CloseableChannel
public boolean supportsOption(org.xnio.Option<?> option)
supportsOption
in interface org.xnio.channels.Configurable
public <T> T getOption(org.xnio.Option<T> tOption) throws IOException
getOption
in interface org.xnio.channels.Configurable
IOException
public <T> T setOption(org.xnio.Option<T> tOption, T t) throws IllegalArgumentException, IOException
setOption
in interface org.xnio.channels.Configurable
IllegalArgumentException
IOException
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read
in interface ScatteringByteChannel
IOException
public long read(ByteBuffer[] dsts) throws IOException
read
in interface ScatteringByteChannel
IOException
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
close
in interface InterruptibleChannel
close
in interface org.xnio.channels.CloseableChannel
IOException
protected AbstractFramedChannel<C,R,S> getFramedChannel()
protected int getReadFrameCount()
Copyright © 2014 JBoss by Red Hat. All rights reserved.