public final class KeepOpenInputStream extends FilterInputStream
A wrapper around an InputStream that turns the close method into a no-op, and
requires the calling of the doClose method instead.
This is necessary, because Jersey closes a stream once it has been read, but we may want to reset and read it again for retries.
in| Constructor and Description |
|---|
KeepOpenInputStream(InputStream is) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static void |
closeStream(InputStream is)
Close a stream, dealing properly with
KeepOpenInputStreams. |
void |
doClose()
This method actually closes the stream, what
close() is not doing. |
available, mark, markSupported, read, read, read, reset, skippublic KeepOpenInputStream(InputStream is)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterInputStreamIOExceptionpublic void doClose()
throws IOException
This method actually closes the stream, what close() is not doing.
IOException - if actually closing the stream throws an exceptionpublic static void closeStream(InputStream is)
Close a stream, dealing properly with KeepOpenInputStreams.
is - input stream to closeCopyright © 2016–2024. All rights reserved.