org.springframework.mock.web

Class DelegatingServletInputStream

    • Constructor Summary

      Constructors 
      Constructor and Description
      DelegatingServletInputStream(java.io.InputStream sourceStream)
      Create a DelegatingServletInputStream for the given source stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int available() 
      void close() 
      java.io.InputStream getSourceStream()
      Return the underlying source stream (never null).
      boolean isFinished()
      Returns true when all the data from the stream has been read else it returns false.
      boolean isReady()
      Returns true if data can be read without blocking else returns false.
      int read() 
      void setReadListener(ReadListener readListener)
      Instructs the ServletInputStream to invoke the provided ReadListener when it is possible to read
      • Methods inherited from class java.io.InputStream

        mark, markSupported, read, read, reset, skip
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DelegatingServletInputStream

        public DelegatingServletInputStream(java.io.InputStream sourceStream)
        Create a DelegatingServletInputStream for the given source stream.
        Parameters:
        sourceStream - the source stream (never null)
    • Method Detail

      • getSourceStream

        public final java.io.InputStream getSourceStream()
        Return the underlying source stream (never null).
      • read

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

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException
      • close

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

        public boolean isFinished()
        Description copied from class: javax.servlet.ServletInputStream
        Returns true when all the data from the stream has been read else it returns false.
        Specified by:
        isFinished in class ServletInputStream
        Returns:
        true when all data for this particular request has been read, otherwise returns false.
      • isReady

        public boolean isReady()
        Description copied from class: javax.servlet.ServletInputStream
        Returns true if data can be read without blocking else returns false.
        Specified by:
        isReady in class ServletInputStream
        Returns:
        true if data can be obtained without blocking, otherwise returns false.