Class ResettableServletInputStream

java.lang.Object
java.io.InputStream
jakarta.servlet.ServletInputStream
org.hawaiiframework.logging.web.util.ResettableServletInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class ResettableServletInputStream extends jakarta.servlet.ServletInputStream
Input stream that can be 'reset', that is, the stream can be reset by supplying the (original) data again.
Since:
2.0.0
  • Constructor Details

    • ResettableServletInputStream

      public ResettableServletInputStream(byte[] rawData)
      The constructor.
      Parameters:
      rawData - A copy of another servlet input stream.
  • Method Details

    • read

      public int read() throws IOException
      Specified by:
      read in class InputStream
      Throws:
      IOException
    • 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 listener)
      Specified by:
      setReadListener in class jakarta.servlet.ServletInputStream
    • reset

      public void reset() throws IOException
      Set the input to use for the stream.
      Overrides:
      reset in class InputStream
      Throws:
      IOException - in case the stream cannot be reset.