Class Nio2Channel.ClosedNio2Channel

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.AsynchronousByteChannel, java.nio.channels.AsynchronousChannel, java.nio.channels.Channel
    Enclosing class:
    Nio2Channel

    public static class Nio2Channel.ClosedNio2Channel
    extends Nio2Channel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes this channel.
      void free()
      Free the channel memory
      boolean isOpen()
      Tells whether or not this channel is open.
      java.util.concurrent.Future<java.lang.Integer> read​(java.nio.ByteBuffer dst)  
      <A> void read​(java.nio.ByteBuffer[] dsts, int offset, int length, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Long,​? super A> handler)  
      <A> void read​(java.nio.ByteBuffer dst, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Integer,​? super A> handler)  
      void reset​(java.nio.channels.AsynchronousSocketChannel channel, SocketWrapperBase<Nio2Channel> socket)
      Reset the channel.
      void setAppReadBufHandler​(ApplicationBufferHandler handler)  
      java.lang.String toString()  
      java.util.concurrent.Future<java.lang.Integer> write​(java.nio.ByteBuffer src)  
      <A> void write​(java.nio.ByteBuffer[] srcs, int offset, int length, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Long,​? super A> handler)  
      <A> void write​(java.nio.ByteBuffer src, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Integer,​? super A> handler)  
      • Methods inherited from class java.lang.Object

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

      • ClosedNio2Channel

        public ClosedNio2Channel()
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Description copied from class: Nio2Channel
        Closes this channel.
        Specified by:
        close in interface java.nio.channels.AsynchronousChannel
        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
        Overrides:
        close in class Nio2Channel
        Throws:
        java.io.IOException - If an I/O error occurs
      • isOpen

        public boolean isOpen()
        Description copied from class: Nio2Channel
        Tells whether or not this channel is open.
        Specified by:
        isOpen in interface java.nio.channels.Channel
        Overrides:
        isOpen in class Nio2Channel
        Returns:
        true if, and only if, this channel is open
      • reset

        public void reset​(java.nio.channels.AsynchronousSocketChannel channel,
                          SocketWrapperBase<Nio2Channel> socket)
                   throws java.io.IOException
        Description copied from class: Nio2Channel
        Reset the channel.
        Overrides:
        reset in class Nio2Channel
        Parameters:
        channel - The new async channel to associate with this NIO2 channel
        socket - The new socket to associate with this NIO2 channel
        Throws:
        java.io.IOException - If a problem was encountered resetting the channel
      • free

        public void free()
        Description copied from class: Nio2Channel
        Free the channel memory
        Overrides:
        free in class Nio2Channel
      • read

        public java.util.concurrent.Future<java.lang.Integer> read​(java.nio.ByteBuffer dst)
        Specified by:
        read in interface java.nio.channels.AsynchronousByteChannel
        Overrides:
        read in class Nio2Channel
      • read

        public <A> void read​(java.nio.ByteBuffer dst,
                             long timeout,
                             java.util.concurrent.TimeUnit unit,
                             A attachment,
                             java.nio.channels.CompletionHandler<java.lang.Integer,​? super A> handler)
        Overrides:
        read in class Nio2Channel
      • read

        public <A> void read​(java.nio.ByteBuffer[] dsts,
                             int offset,
                             int length,
                             long timeout,
                             java.util.concurrent.TimeUnit unit,
                             A attachment,
                             java.nio.channels.CompletionHandler<java.lang.Long,​? super A> handler)
        Overrides:
        read in class Nio2Channel
      • write

        public java.util.concurrent.Future<java.lang.Integer> write​(java.nio.ByteBuffer src)
        Specified by:
        write in interface java.nio.channels.AsynchronousByteChannel
        Overrides:
        write in class Nio2Channel
      • write

        public <A> void write​(java.nio.ByteBuffer src,
                              long timeout,
                              java.util.concurrent.TimeUnit unit,
                              A attachment,
                              java.nio.channels.CompletionHandler<java.lang.Integer,​? super A> handler)
        Overrides:
        write in class Nio2Channel
      • write

        public <A> void write​(java.nio.ByteBuffer[] srcs,
                              int offset,
                              int length,
                              long timeout,
                              java.util.concurrent.TimeUnit unit,
                              A attachment,
                              java.nio.channels.CompletionHandler<java.lang.Long,​? super A> handler)
        Overrides:
        write in class Nio2Channel