Class HttpOutput

    • Constructor Detail

      • HttpOutput

        public HttpOutput​(HttpChannel channel)
    • Method Detail

      • isWritten

        public boolean isWritten()
      • getWritten

        public long getWritten()
      • reopen

        public void reopen()
      • isAllContentWritten

        public boolean isAllContentWritten()
      • acquireWriteBlockingCallback

        protected org.eclipse.jetty.util.SharedBlockingCallback.Blocker acquireWriteBlockingCallback()
                                                                                              throws IOException
        Throws:
        IOException
      • write

        protected void write​(ByteBuffer content,
                             boolean complete,
                             org.eclipse.jetty.util.Callback callback)
      • isClosed

        public boolean isClosed()
      • isAsync

        public boolean isAsync()
      • sendContent

        public void sendContent​(ByteBuffer content)
                         throws IOException
        Blocking send of whole content.
        Parameters:
        content - The whole content to send
        Throws:
        IOException - if the send fails
      • sendContent

        public void sendContent​(InputStream in)
                         throws IOException
        Blocking send of stream content.
        Parameters:
        in - The stream content to send
        Throws:
        IOException - if the send fails
      • sendContent

        public void sendContent​(ReadableByteChannel in)
                         throws IOException
        Blocking send of channel content.
        Parameters:
        in - The channel content to send
        Throws:
        IOException - if the send fails
      • sendContent

        public void sendContent​(org.eclipse.jetty.http.HttpContent content)
                         throws IOException
        Blocking send of HTTP content.
        Parameters:
        content - The HTTP content to send
        Throws:
        IOException - if the send fails
      • sendContent

        public void sendContent​(ByteBuffer content,
                                org.eclipse.jetty.util.Callback callback)
        Asynchronous send of whole content.
        Parameters:
        content - The whole content to send
        callback - The callback to use to notify success or failure
      • sendContent

        public void sendContent​(InputStream in,
                                org.eclipse.jetty.util.Callback callback)
        Asynchronous send of stream content. The stream will be closed after reading all content.
        Parameters:
        in - The stream content to send
        callback - The callback to use to notify success or failure
      • sendContent

        public void sendContent​(ReadableByteChannel in,
                                org.eclipse.jetty.util.Callback callback)
        Asynchronous send of channel content. The channel will be closed after reading all content.
        Parameters:
        in - The channel content to send
        callback - The callback to use to notify success or failure
      • sendContent

        public void sendContent​(org.eclipse.jetty.http.HttpContent httpContent,
                                org.eclipse.jetty.util.Callback callback)
        Asynchronous send of HTTP content.
        Parameters:
        httpContent - The HTTP content to send
        callback - The callback to use to notify success or failure
      • getBufferSize

        public int getBufferSize()
      • setBufferSize

        public void setBufferSize​(int size)
      • onFlushed

        public void onFlushed​(long bytes)
                       throws IOException

        Invoked when bytes have been flushed to the network.

        The number of flushed bytes may be different from the bytes written by the application if an HttpOutput.Interceptor changed them, for example by compressing them.

        Parameters:
        bytes - the number of bytes flushed
        Throws:
        IOException - if the minimum data rate, when set, is not respected
        See Also:
        WriteFlusher.Listener
      • recycle

        public void recycle()
      • resetBuffer

        public void resetBuffer()
      • run

        public void run()
        Specified by:
        run in interface Runnable