Class ChannelFunctionStreamSourceChannel

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.Channel, java.nio.channels.InterruptibleChannel, java.nio.channels.ReadableByteChannel, java.nio.channels.ScatteringByteChannel, org.xnio.channels.CloseableChannel, org.xnio.channels.Configurable, org.xnio.channels.StreamSourceChannel, org.xnio.channels.SuspendableReadChannel

    public class ChannelFunctionStreamSourceChannel
    extends java.lang.Object
    implements org.xnio.channels.StreamSourceChannel
    Author:
    Norman Maurer
    • Field Summary

      • Fields inherited from interface org.xnio.channels.Configurable

        EMPTY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void awaitReadable()  
      void awaitReadable​(long time, java.util.concurrent.TimeUnit timeUnit)  
      void close()  
      org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel> getCloseSetter()  
      org.xnio.XnioIoThread getIoThread()  
      <T> T getOption​(org.xnio.Option<T> option)  
      org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel> getReadSetter()  
      org.xnio.XnioExecutor getReadThread()  
      org.xnio.XnioWorker getWorker()  
      boolean isOpen()  
      boolean isReadResumed()  
      int read​(java.nio.ByteBuffer dst)  
      long read​(java.nio.ByteBuffer[] dsts)  
      long read​(java.nio.ByteBuffer[] dsts, int offset, int length)  
      void resumeReads()  
      <T> T setOption​(org.xnio.Option<T> option, T value)  
      void shutdownReads()  
      boolean supportsOption​(org.xnio.Option<?> option)  
      void suspendReads()  
      long transferTo​(long position, long count, java.nio.channels.FileChannel target)  
      long transferTo​(long count, java.nio.ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel target)  
      void wakeupReads()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChannelFunctionStreamSourceChannel

        public ChannelFunctionStreamSourceChannel​(org.xnio.channels.StreamSourceChannel channel,
                                                  ChannelFunction... functions)
    • Method Detail

      • transferTo

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

        public long transferTo​(long count,
                               java.nio.ByteBuffer throughBuffer,
                               org.xnio.channels.StreamSinkChannel target)
                        throws java.io.IOException
        Specified by:
        transferTo in interface org.xnio.channels.StreamSourceChannel
        Throws:
        java.io.IOException
      • getReadSetter

        public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel> 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 org.xnio.channels.StreamSourceChannel> 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
      • read

        public long read​(java.nio.ByteBuffer[] dsts,
                         int offset,
                         int length)
                  throws java.io.IOException
        Specified by:
        read in interface java.nio.channels.ScatteringByteChannel
        Throws:
        java.io.IOException
      • read

        public long read​(java.nio.ByteBuffer[] dsts)
                  throws java.io.IOException
        Specified by:
        read in interface java.nio.channels.ScatteringByteChannel
        Throws:
        java.io.IOException
      • suspendReads

        public void suspendReads()
        Specified by:
        suspendReads in interface org.xnio.channels.SuspendableReadChannel
      • 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
      • shutdownReads

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

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

        public void awaitReadable​(long time,
                                  java.util.concurrent.TimeUnit timeUnit)
                           throws java.io.IOException
        Specified by:
        awaitReadable in interface org.xnio.channels.SuspendableReadChannel
        Throws:
        java.io.IOException
      • getReadThread

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

        public int read​(java.nio.ByteBuffer dst)
                 throws java.io.IOException
        Specified by:
        read in interface java.nio.channels.ReadableByteChannel
        Throws:
        java.io.IOException
      • 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> option)
                        throws java.io.IOException
        Specified by:
        getOption in interface org.xnio.channels.Configurable
        Throws:
        java.io.IOException
      • setOption

        public <T> T setOption​(org.xnio.Option<T> option,
                               T value)
                        throws java.io.IOException
        Specified by:
        setOption in interface org.xnio.channels.Configurable
        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.lang.AutoCloseable
        Specified by:
        close in interface java.nio.channels.Channel
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface org.xnio.channels.CloseableChannel
        Specified by:
        close in interface java.nio.channels.InterruptibleChannel
        Throws:
        java.io.IOException