Class EmptyStreamSourceConduit

  • All Implemented Interfaces:
    org.xnio.conduits.Conduit, org.xnio.conduits.SourceConduit, org.xnio.conduits.StreamSourceConduit

    public final class EmptyStreamSourceConduit
    extends Object
    implements org.xnio.conduits.StreamSourceConduit
    A stream source conduit which is always empty. Temporary copy from XNIO, see https://issues.jboss.org/browse/XNIO-199
    Author:
    David M. Lloyd
    • Constructor Detail

      • EmptyStreamSourceConduit

        public EmptyStreamSourceConduit​(org.xnio.XnioIoThread readThread)
        Construct a new instance.
        Parameters:
        readThread - the read thread for this conduit
    • Method Detail

      • setReadReadyHandler

        public void setReadReadyHandler​(org.xnio.conduits.ReadReadyHandler handler)
        Specified by:
        setReadReadyHandler in interface org.xnio.conduits.SourceConduit
      • transferTo

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

        public long transferTo​(long count,
                               ByteBuffer throughBuffer,
                               org.xnio.channels.StreamSinkChannel target)
                        throws IOException
        Specified by:
        transferTo in interface org.xnio.conduits.StreamSourceConduit
        Throws:
        IOException
      • read

        public long read​(ByteBuffer[] dsts,
                         int offs,
                         int len)
                  throws IOException
        Specified by:
        read in interface org.xnio.conduits.StreamSourceConduit
        Throws:
        IOException
      • isReadShutdown

        public boolean isReadShutdown()
        Specified by:
        isReadShutdown in interface org.xnio.conduits.SourceConduit
      • resumeReads

        public void resumeReads()
        Specified by:
        resumeReads in interface org.xnio.conduits.SourceConduit
      • suspendReads

        public void suspendReads()
        Specified by:
        suspendReads in interface org.xnio.conduits.SourceConduit
      • wakeupReads

        public void wakeupReads()
        Specified by:
        wakeupReads in interface org.xnio.conduits.SourceConduit
      • isReadResumed

        public boolean isReadResumed()
        Specified by:
        isReadResumed in interface org.xnio.conduits.SourceConduit
      • awaitReadable

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

        public void awaitReadable​(long time,
                                  TimeUnit timeUnit)
                           throws IOException
        Specified by:
        awaitReadable in interface org.xnio.conduits.SourceConduit
        Throws:
        IOException
      • terminateReads

        public void terminateReads()
                            throws IOException
        Specified by:
        terminateReads in interface org.xnio.conduits.SourceConduit
        Throws:
        IOException
      • getReadThread

        public org.xnio.XnioIoThread getReadThread()
        Specified by:
        getReadThread in interface org.xnio.conduits.SourceConduit
      • getWorker

        public org.xnio.XnioWorker getWorker()
        Specified by:
        getWorker in interface org.xnio.conduits.Conduit