public class EntityInputStream extends InputStream
| Constructor and Description |
|---|
EntityInputStream(InputStream input)
Extension constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
static EntityInputStream |
create(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.
|
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(InputStream wrapped)
Set the wrapped input stream instance.
|
long |
skip(long n) |
public EntityInputStream(InputStream input)
input - underlying wrapped input stream.public static EntityInputStream create(InputStream inputStream)
EntityInputStream,
the stream is returned without wrapping.inputStream - input stream.public int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void mark(int readLimit)
mark in class InputStreampublic boolean markSupported()
markSupported in class 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 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 Closeableclose in interface AutoCloseableclose in class 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 IllegalStateException
IllegalStateException - in case the entity input stream has been closed.public boolean isClosed()
true if the stream has been closed, false otherwise.public final InputStream getWrappedStream()
public final void setWrappedStream(InputStream wrapped)
wrapped - new input stream instance to be wrapped.Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.