Package org.apache.solr.servlet
Class ServletInputStreamWrapper
- java.lang.Object
-
- java.io.InputStream
-
- javax.servlet.ServletInputStream
-
- org.apache.solr.servlet.ServletInputStreamWrapper
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ServletInputStreamWrapper extends javax.servlet.ServletInputStream
Provides a convenient extension of theServletInputStream
class that can be subclassed by developers wishing to adapt the behavior of a Stream. One such example may be to overrideclose()
to instead be a no-op as in SOLR-8933. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped stream.
-
-
Constructor Summary
Constructors Constructor Description ServletInputStreamWrapper(javax.servlet.ServletInputStream stream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
boolean
equals(Object obj)
int
hashCode()
boolean
isFinished()
boolean
isReady()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
int
readLine(byte[] b, int off, int len)
void
reset()
void
setReadListener(javax.servlet.ReadListener arg0)
long
skip(long n)
String
toString()
-
-
-
Constructor Detail
-
ServletInputStreamWrapper
public ServletInputStreamWrapper(javax.servlet.ServletInputStream stream) throws IOException
- Throws:
IOException
-
-
Method Detail
-
available
public int available() throws IOException
- Overrides:
available
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
-
isFinished
public boolean isFinished()
- Specified by:
isFinished
in classjavax.servlet.ServletInputStream
-
isReady
public boolean isReady()
- Specified by:
isReady
in classjavax.servlet.ServletInputStream
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
readLine
public int readLine(byte[] b, int off, int len) throws IOException
- Overrides:
readLine
in classjavax.servlet.ServletInputStream
- Throws:
IOException
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
setReadListener
public void setReadListener(javax.servlet.ReadListener arg0)
- Specified by:
setReadListener
in classjavax.servlet.ServletInputStream
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
-