Class BufferPoolServerOutputStream<B>

    • Method Detail

      • getServerWriter

        public ServerWriter getServerWriter​(java.nio.charset.Charset charset)
                                     throws java.io.IOException
        Obtains the ServerWriter.
        Parameters:
        charset - Charset for writing out String data.
        Returns:
        ServerWriter.
        Throws:
        java.io.IOException - Should ServerOutputStream be closed.
      • getContentLength

        public long getContentLength()
        Obtains the content length of output data.
        Returns:
        Content length of output data.
      • clear

        public void clear()
                   throws java.io.IOException
        Clears this OutputStream and releases the StreamBuffer instances.
        Throws:
        java.io.IOException - If failure in clearing OutputStream.
      • write

        public void write​(java.nio.ByteBuffer buffer)
                   throws java.io.IOException
        Description copied from class: ServerOutputStream

        Writes a ByteBuffer.

        This is to enable efficient I/O of writing content (typically cached).

        Specified by:
        write in class ServerOutputStream
        Parameters:
        buffer - ByteBuffer that should never change its content.
        Throws:
        java.io.IOException - If fails to write the ByteBuffer.
      • write

        public void write​(java.nio.channels.FileChannel file,
                          long position,
                          long count,
                          FileCompleteCallback callback)
                   throws java.io.IOException
        Description copied from class: ServerOutputStream

        Writes part of the FileChannel contents.

        This is to enable efficient I/O (ie DMA) of writing FileChannel content.

        To write the entire FileChannel contents, invoke write(file, 0, -1).

        Note that the underlying implementation will need to support FileChannel efficiencies.

        Specified by:
        write in class ServerOutputStream
        Parameters:
        file - FileChannel.
        position - Position within the FileChannel to start writing content. Must be non-negative number.
        count - Count of bytes to write from the FileChannel. A negative value (typically -1) indicates to write the remaining FileChannel content from position.
        callback - Optional FileCompleteCallback. May be null.
        Throws:
        java.io.IOException - If fails to write the FileChannel content.
      • write

        public void write​(java.nio.channels.FileChannel file,
                          FileCompleteCallback callback)
                   throws java.io.IOException
        Description copied from class: ServerOutputStream

        Writes the entire FileChannel contents.

        This is a convenience method for write(file, 0, -1).

        Specified by:
        write in class ServerOutputStream
        Parameters:
        file - FileChannel.
        callback - Optional FileCompleteCallback. May be null.
        Throws:
        java.io.IOException - If fails to write the FileChannel content.
      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] bytes,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException