java.lang.Object
org.arquillian.cube.kubernetes.impl.portforward.ChannelUtils

public final class ChannelUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <I extends org.xnio.channels.StreamSourceChannel, O extends org.xnio.channels.StreamSinkChannel>
    void
    initiateTransfer(long count, I source, O sink, org.xnio.ChannelListener<? super I> sourceListener, org.xnio.ChannelListener<? super O> sinkListener, org.xnio.ChannelExceptionHandler<? super I> readExceptionHandler, org.xnio.ChannelExceptionHandler<? super O> writeExceptionHandler, org.xnio.Pool<ByteBuffer> pool)
    This is basically a copy of ChannelListeners.initiateTransfer(), but invokes a flush() on the sink after writing is complete.
    static <I extends org.xnio.channels.StreamSourceChannel, O extends org.xnio.channels.StreamSinkChannel>
    void
    initiateTransfer(long count, I source, O sink, org.xnio.Pool<ByteBuffer> pool)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • initiateTransfer

      public static <I extends org.xnio.channels.StreamSourceChannel, O extends org.xnio.channels.StreamSinkChannel> void initiateTransfer(long count, I source, O sink, org.xnio.Pool<ByteBuffer> pool)
    • initiateTransfer

      public static <I extends org.xnio.channels.StreamSourceChannel, O extends org.xnio.channels.StreamSinkChannel> void initiateTransfer(long count, I source, O sink, org.xnio.ChannelListener<? super I> sourceListener, org.xnio.ChannelListener<? super O> sinkListener, org.xnio.ChannelExceptionHandler<? super I> readExceptionHandler, org.xnio.ChannelExceptionHandler<? super O> writeExceptionHandler, org.xnio.Pool<ByteBuffer> pool)
      This is basically a copy of ChannelListeners.initiateTransfer(), but invokes a flush() on the sink after writing is complete.

      Initiate a low-copy transfer between two stream channels. The pool should be a direct buffer pool for best performance.

      Parameters:
      count - the number of bytes to transfer, or Long.MAX_VALUE to transfer all remaining bytes
      source - the source channel
      sink - the target channel
      sourceListener - the source listener to set and call when the transfer is complete, or null to clear the listener at that time
      sinkListener - the target listener to set and call when the transfer is complete, or null to clear the listener at that time
      readExceptionHandler - the read exception handler to call if an error occurs during a read operation
      writeExceptionHandler - the write exception handler to call if an error occurs during a write operation
      pool - the pool from which the transfer buffer should be allocated