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.FilterInputStream
in 
 - 
 
- 
Constructor Summary
Constructors Constructor Description KeepOpenInputStream(InputStream is) 
- 
Method Summary
All 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.FilterInputStream
available, mark, markSupported, read, read, read, reset, skip 
- 
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
KeepOpenInputStream
public KeepOpenInputStream(InputStream is)
 
 - 
 
- 
Method Detail
- 
close
public void close() throws IOException- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Overrides:
 closein classFilterInputStream- Throws:
 IOException
 
- 
doClose
public void doClose() throws IOExceptionThis method actually closes the stream, what close() is not doing.- Throws:
 IOException- if actually closing the stream throws an exception
 
- 
closeStream
public static void closeStream(InputStream is)
Close a stream, dealing properly withKeepOpenInputStreams.- Parameters:
 is- input stream to close
 
 - 
 
 -