Class OutputStreamWrapperChannel

    • Constructor Detail

      • OutputStreamWrapperChannel

        public OutputStreamWrapperChannel​(java.io.OutputStream out,
                                          int buffSize)
    • Method Detail

      • write

        public final int write​(java.nio.ByteBuffer src)
                        throws java.io.IOException
        Specified by:
        write in interface java.nio.channels.WritableByteChannel
        Throws:
        java.io.IOException
      • getThreadLocalInstance

        public static BufferedWritableByteChannel getThreadLocalInstance​(java.io.OutputStream out,
                                                                         long remainingSize)
                                                                  throws java.lang.IllegalStateException
        Wraps the given output stream into the special stateless and reusable (thread local) byte channel
        Parameters:
        out - the output stream to wrap into the byte channel
        remainingSize - the estimated size of the data to be written to the given output
        Returns:
        writable byte channel
        Throws:
        java.lang.IllegalStateException - if negative remaining size is specified
      • close

        public void close()
                   throws java.io.IOException
        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
        Throws:
        java.io.IOException