Class HttpInput

java.lang.Object
java.io.InputStream
javax.servlet.ServletInputStream
org.eclipse.jetty.server.HttpInput
All Implemented Interfaces:
Closeable, AutoCloseable, Runnable

public class HttpInput extends javax.servlet.ServletInputStream implements 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.

  • Constructor Details

  • Method Details

    • 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.
    • addInterceptor

      public void addInterceptor(HttpInput.Interceptor interceptor)
      Set the HttpInput.Interceptor, chaining it to the existing one if an HttpInput.Interceptor is already set.
      Parameters:
      interceptor - the next HttpInput.Interceptor in a chain
    • 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 javax.servlet.ServletInputStream
    • isReady

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

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

      public boolean onContentProducible()
    • read

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

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

      public int read(ByteBuffer buffer) throws IOException
      Throws:
      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 InputStream
    • run

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

      public String toString()
      Overrides:
      toString in class Object