Interface RawChannel

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable


    public interface RawChannel
    extends java.io.Closeable
    • Method Detail

      • registerEvent

        void registerEvent(RawChannel.RawEvent event)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • initialByteBuffer

        java.nio.ByteBuffer initialByteBuffer()
                                       throws java.lang.IllegalStateException
        Hands over the initial bytes. Once the bytes have been returned they are no longer available and the method will throw an IllegalStateException on each subsequent invocation.
        Returns:
        the initial bytes
        Throws:
        java.lang.IllegalStateException - if the method has been already invoked
      • read

        java.nio.ByteBuffer read()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        long write(java.nio.ByteBuffer[] srcs,
                   int offset,
                   int length)
            throws java.io.IOException
        Throws:
        java.io.IOException
      • shutdownInput

        void shutdownInput()
                    throws java.io.IOException
        Shutdown the connection for reading without closing the channel.

        Once shutdown for reading then further reads on the channel will return null, the end-of-stream indication. If the input side of the connection is already shutdown then invoking this method has no effect.

        Throws:
        java.nio.channels.ClosedChannelException - If this channel is closed
        java.io.IOException - If some other I/O error occurs
      • shutdownOutput

        void shutdownOutput()
                     throws java.io.IOException
        Shutdown the connection for writing without closing the channel.

        Once shutdown for writing then further attempts to write to the channel will throw ClosedChannelException. If the output side of the connection is already shutdown then invoking this method has no effect.

        Throws:
        java.nio.channels.ClosedChannelException - If this channel is closed
        java.io.IOException - If some other I/O error occurs
      • close

        void close()
            throws java.io.IOException
        Closes this channel.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException - If an I/O error occurs