Package com.helger.servlet.mock
Class MockServletInputStream
- java.lang.Object
-
- java.io.InputStream
-
- jakarta.servlet.ServletInputStream
-
- com.helger.servlet.io.AbstractServletInputStream
-
- com.helger.servlet.mock.MockServletInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MockServletInputStream extends AbstractServletInputStream
AServletInputStreamfor testing based on a predefined byte array or an existingInputStream.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description MockServletInputStream(byte[] aContent)MockServletInputStream(InputStream aBaseIS)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intread()-
Methods inherited from class com.helger.servlet.io.AbstractServletInputStream
isFinished, isReady, setReadListener
-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
MockServletInputStream
public MockServletInputStream(@Nonnull byte[] aContent)
-
MockServletInputStream
public MockServletInputStream(@Nonnull InputStream aBaseIS)
-
-
Method Detail
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
-