Class HttpInput

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Runnable

    public class HttpInput
    extends jakarta.servlet.ServletInputStream
    implements java.lang.Runnable

    While this class is-a Runnable, it should never be dispatched in it's own thread. It is a runnable only so that the calling thread can use ContextHandler.handle(Runnable) to setup classloaders etc.

    • Method Detail

      • recycle

        public void recycle()
      • reopen

        public void reopen()
      • getInterceptor

        public HttpInput.Interceptor getInterceptor()
        Returns:
        The current Interceptor, or null if none set
      • setInterceptor

        public void setInterceptor​(HttpInput.Interceptor interceptor)
        Set the interceptor.
        Parameters:
        interceptor - The interceptor to use.
      • getContentConsumed

        public long getContentConsumed()
      • getContentReceived

        public long getContentReceived()
      • consumeAll

        public boolean consumeAll()
      • isError

        public boolean isError()
      • isAsync

        public boolean isAsync()
      • isFinished

        public boolean isFinished()
        Specified by:
        isFinished in class jakarta.servlet.ServletInputStream
      • isReady

        public boolean isReady()
        Specified by:
        isReady in class jakarta.servlet.ServletInputStream
      • setReadListener

        public void setReadListener​(jakarta.servlet.ReadListener readListener)
        Specified by:
        setReadListener in class jakarta.servlet.ServletInputStream
      • onContentProducible

        public boolean onContentProducible()
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • hasContent

        public boolean hasContent()
        Check if this HttpInput instance has content stored internally, without fetching/parsing anything from the underlying channel.
        Returns:
        true if the input contains content, false otherwise.
      • available

        public int available()
        Overrides:
        available in class java.io.InputStream
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object