Class DebuggingStreamSourceConduit

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

    public class DebuggingStreamSourceConduit
    extends org.xnio.conduits.AbstractStreamSourceConduit<org.xnio.conduits.StreamSourceConduit>
    Conduit that saves all the data that is written through it and can dump it to the console

    Obviously this should not be used in production.

    Author:
    Stuart Douglas
    • Field Summary

      • Fields inherited from class org.xnio.conduits.AbstractConduit

        next
    • Constructor Summary

      Constructors 
      Constructor Description
      DebuggingStreamSourceConduit​(org.xnio.conduits.StreamSourceConduit next)
      Construct a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void dump()  
      int read​(ByteBuffer dst)  
      long read​(ByteBuffer[] dsts, int offs, int len)  
      long transferTo​(long position, long count, FileChannel target)  
      long transferTo​(long count, ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel target)  
      • Methods inherited from class org.xnio.conduits.AbstractSourceConduit

        awaitReadable, awaitReadable, getReadThread, isReadResumed, isReadShutdown, resumeReads, setReadReadyHandler, suspendReads, terminateReads, wakeupReads
      • Methods inherited from class org.xnio.conduits.AbstractConduit

        getWorker
      • Methods inherited from interface org.xnio.conduits.Conduit

        getWorker
      • Methods inherited from interface org.xnio.conduits.SourceConduit

        awaitReadable, awaitReadable, getReadThread, isReadResumed, isReadShutdown, resumeReads, setReadReadyHandler, suspendReads, terminateReads, wakeupReads
    • Constructor Detail

      • DebuggingStreamSourceConduit

        public DebuggingStreamSourceConduit​(org.xnio.conduits.StreamSourceConduit next)
        Construct a new instance.
        Parameters:
        next - the delegate conduit to set
    • Method Detail

      • transferTo

        public long transferTo​(long position,
                               long count,
                               FileChannel target)
                        throws IOException
        Specified by:
        transferTo in interface org.xnio.conduits.StreamSourceConduit
        Overrides:
        transferTo in class org.xnio.conduits.AbstractStreamSourceConduit<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
        Overrides:
        transferTo in class org.xnio.conduits.AbstractStreamSourceConduit<org.xnio.conduits.StreamSourceConduit>
        Throws:
        IOException
      • read

        public int read​(ByteBuffer dst)
                 throws IOException
        Specified by:
        read in interface org.xnio.conduits.StreamSourceConduit
        Overrides:
        read in class org.xnio.conduits.AbstractStreamSourceConduit<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
        Overrides:
        read in class org.xnio.conduits.AbstractStreamSourceConduit<org.xnio.conduits.StreamSourceConduit>
        Throws:
        IOException
      • dump

        public static void dump()