Class AbstractFramedStreamSourceChannel<C extends AbstractFramedChannel<C,​R,​S>,​R extends AbstractFramedStreamSourceChannel<C,​R,​S>,​S extends AbstractFramedStreamSinkChannel<C,​R,​S>>

    • Constructor Detail

      • AbstractFramedStreamSourceChannel

        public AbstractFramedStreamSourceChannel​(C framedChannel)
      • AbstractFramedStreamSourceChannel

        public AbstractFramedStreamSourceChannel​(C framedChannel,
                                                 PooledByteBuffer data,
                                                 long frameDataRemaining)
    • Method Detail

      • transferTo

        public long transferTo​(long position,
                               long count,
                               FileChannel target)
                        throws IOException
        Specified by:
        transferTo in interface org.xnio.channels.StreamSourceChannel
        Throws:
        IOException
      • transferTo

        public long transferTo​(long count,
                               ByteBuffer throughBuffer,
                               org.xnio.channels.StreamSinkChannel streamSinkChannel)
                        throws IOException
        Specified by:
        transferTo in interface org.xnio.channels.StreamSourceChannel
        Throws:
        IOException
      • getMaxStreamSize

        public long getMaxStreamSize()
      • setMaxStreamSize

        public void setMaxStreamSize​(long maxStreamSize)
      • suspendReads

        public void suspendReads()
        Specified by:
        suspendReads in interface org.xnio.channels.SuspendableReadChannel
      • complete

        protected void complete()
                         throws IOException
        Method that is invoked when all data has been read.
        Throws:
        IOException
      • isComplete

        protected boolean isComplete()
      • resumeReads

        public void resumeReads()
        Specified by:
        resumeReads in interface org.xnio.channels.SuspendableReadChannel
      • isReadResumed

        public boolean isReadResumed()
        Specified by:
        isReadResumed in interface org.xnio.channels.SuspendableReadChannel
      • wakeupReads

        public void wakeupReads()
        Specified by:
        wakeupReads in interface org.xnio.channels.SuspendableReadChannel
      • addCloseTask

        public void addCloseTask​(org.xnio.ChannelListener<R> channelListener)
      • shutdownReads

        public void shutdownReads()
                           throws IOException
        Specified by:
        shutdownReads in interface org.xnio.channels.SuspendableReadChannel
        Throws:
        IOException
      • lastFrame

        protected void lastFrame()
      • isLastFrame

        protected boolean isLastFrame()
      • awaitReadable

        public void awaitReadable()
                           throws IOException
        Specified by:
        awaitReadable in interface org.xnio.channels.SuspendableReadChannel
        Throws:
        IOException
      • awaitReadable

        public void awaitReadable​(long l,
                                  TimeUnit timeUnit)
                           throws IOException
        Specified by:
        awaitReadable in interface org.xnio.channels.SuspendableReadChannel
        Throws:
        IOException
      • dataReady

        protected void dataReady​(FrameHeaderData headerData,
                                 PooledByteBuffer frameData)
        Called when data has been read from the underlying channel.
        Parameters:
        headerData - The frame header data. This may be null if the data is part of a an existing frame
        frameData - The frame data
      • updateFrameDataRemaining

        protected long updateFrameDataRemaining​(PooledByteBuffer frameData,
                                                long frameDataRemaining)
      • handleHeaderData

        protected void handleHeaderData​(FrameHeaderData headerData)
      • getReadThread

        public org.xnio.XnioExecutor getReadThread()
        Specified by:
        getReadThread in interface org.xnio.channels.SuspendableReadChannel
      • getReadSetter

        public org.xnio.ChannelListener.Setter<? extends R> getReadSetter()
        Specified by:
        getReadSetter in interface org.xnio.channels.StreamSourceChannel
        Specified by:
        getReadSetter in interface org.xnio.channels.SuspendableReadChannel
      • getCloseSetter

        public org.xnio.ChannelListener.Setter<? extends R> getCloseSetter()
        Specified by:
        getCloseSetter in interface org.xnio.channels.CloseableChannel
        Specified by:
        getCloseSetter in interface org.xnio.channels.StreamSourceChannel
        Specified by:
        getCloseSetter in interface org.xnio.channels.SuspendableReadChannel
      • getWorker

        public org.xnio.XnioWorker getWorker()
        Specified by:
        getWorker in interface org.xnio.channels.CloseableChannel
      • getIoThread

        public org.xnio.XnioIoThread getIoThread()
        Specified by:
        getIoThread in interface org.xnio.channels.CloseableChannel
      • supportsOption

        public boolean supportsOption​(org.xnio.Option<?> option)
        Specified by:
        supportsOption in interface org.xnio.channels.Configurable
      • getOption

        public <T> T getOption​(org.xnio.Option<T> tOption)
                        throws IOException
        Specified by:
        getOption in interface org.xnio.channels.Configurable
        Throws:
        IOException
      • isOpen

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

        protected void channelForciblyClosed()
      • getFramedChannel

        protected C getFramedChannel()
      • getReadFrameCount

        protected int getReadFrameCount()
      • markStreamBroken

        protected void markStreamBroken()
        Called when this stream is no longer valid. Reads from the stream will result in an exception.