public class EntityInputStream
extends java.io.InputStream
| Modifier and Type | Field and Description |
|---|---|
private boolean |
closed |
private java.io.InputStream |
input |
| Constructor and Description |
|---|
EntityInputStream(java.io.InputStream input)
Extension constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
static EntityInputStream |
create(java.io.InputStream inputStream)
Create an entity input stream instance wrapping the original input stream.
|
void |
ensureNotClosed()
Check that the entity input stream has not been closed yet.
|
java.io.InputStream |
getWrappedStream()
Get the wrapped input stream instance.
|
boolean |
isClosed()
Get the closed status of this input stream.
|
boolean |
isEmpty()
Check if the underlying entity stream is empty.
|
void |
mark(int readLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
void |
setWrappedStream(java.io.InputStream wrapped)
Set the wrapped input stream instance.
|
long |
skip(long n) |
public EntityInputStream(java.io.InputStream input)
input - underlying wrapped input stream.public static EntityInputStream create(java.io.InputStream inputStream)
EntityInputStream,
the stream is returned without wrapping.inputStream - input stream.public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic void mark(int readLimit)
mark in class java.io.InputStreampublic boolean markSupported()
markSupported in class java.io.InputStreampublic void reset()
The method is customized to not throw an IOException if the reset operation fails. Instead,
a runtime ProcessingException is thrown.
reset in class java.io.InputStreamjavax.ws.rs.ProcessingException - in case the reset operation on the underlying entity input stream failed.public void close()
throws javax.ws.rs.ProcessingException
The method is customized to not throw an IOException if the close operation fails. Instead,
a warning message is logged.
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjavax.ws.rs.ProcessingExceptionpublic boolean isEmpty()
Note that the operation may need to block until a first byte (or EOF) is available in the stream.
true if the entity stream is empty, false otherwise.public void ensureNotClosed()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - in case the entity input stream has been closed.public boolean isClosed()
true if the stream has been closed, false otherwise.public final java.io.InputStream getWrappedStream()
public final void setWrappedStream(java.io.InputStream wrapped)
wrapped - new input stream instance to be wrapped.