Package com.oracle.bmc.io.internal
Class KeepOpenInputStream
- java.lang.Object
- 
- java.io.InputStream
- 
- java.io.FilterInputStream
- 
- com.oracle.bmc.io.internal.KeepOpenInputStream
 
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable
 
 public final class KeepOpenInputStream extends FilterInputStream A wrapper around anInputStreamthat 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. 
- 
- 
Field Summary- 
Fields inherited from class java.io.FilterInputStreamin
 
- 
 - 
Constructor SummaryConstructors Constructor Description KeepOpenInputStream(InputStream is)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static voidcloseStream(InputStream is)Close a stream, dealing properly withKeepOpenInputStreams.voiddoClose()This method actually closes the stream, what close() is not doing.- 
Methods inherited from class java.io.FilterInputStreamavailable, mark, markSupported, read, read, read, reset, skip
 - 
Methods inherited from class java.io.InputStreamnullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
 
- 
 
- 
- 
- 
Constructor Detail- 
KeepOpenInputStreampublic KeepOpenInputStream(InputStream is) 
 
- 
 - 
Method Detail- 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- FilterInputStream
- Throws:
- IOException
 
 - 
doClosepublic void doClose() throws IOExceptionThis method actually closes the stream, what close() is not doing.- Throws:
- IOException- if actually closing the stream throws an exception
 
 - 
closeStreampublic static void closeStream(InputStream is) Close a stream, dealing properly withKeepOpenInputStreams.- Parameters:
- is- input stream to close
 
 
- 
 
-