Package org.takes.servlet
Class ServletInputStreamOf
- java.lang.Object
-
- java.io.InputStream
-
- javax.servlet.ServletInputStream
-
- org.takes.servlet.ServletInputStreamOf
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public final class ServletInputStreamOf extends javax.servlet.ServletInputStream
ServletIInputStream that decorates aInputStream
to be used by aHttpServletRequestFake
.- Since:
- 1.15
-
-
Constructor Summary
Constructors Constructor Description ServletInputStreamOf(InputStream input)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
boolean
isFinished()
boolean
isReady()
void
mark(int limit)
boolean
markSupported()
int
read()
int
read(byte[] buffer)
int
read(byte[] buffer, int offset, int length)
void
reset()
void
setReadListener(javax.servlet.ReadListener listener)
long
skip(long num)
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
ServletInputStreamOf
public ServletInputStreamOf(InputStream input)
Ctor.- Parameters:
input
- The encapsulated InputStream
-
-
Method Detail
-
isFinished
public boolean isFinished()
- Specified by:
isFinished
in classjavax.servlet.ServletInputStream
-
isReady
public boolean isReady()
- Specified by:
isReady
in classjavax.servlet.ServletInputStream
-
setReadListener
public void setReadListener(javax.servlet.ReadListener listener)
- Specified by:
setReadListener
in classjavax.servlet.ServletInputStream
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] buffer) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] buffer, int offset, int length) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
skip
public long skip(long num) throws IOException
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
mark
public void mark(int limit)
- Overrides:
mark
in classInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
-