Package com.oracle.bmc.io.internal
Class DuplicatableKeepOpenInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.oracle.bmc.io.internal.KeepOpenInputStream
-
- com.oracle.bmc.io.internal.DuplicatableKeepOpenInputStream
-
- All Implemented Interfaces:
DuplicatableInputStream,Closeable,AutoCloseable
public class DuplicatableKeepOpenInputStream extends KeepOpenInputStream implements DuplicatableInputStream
In Java we cannot specify a type parameter as requiring a type both extend an abstract class, such as InputStream and implement an interface such as DuplicatableInputStream.As such we are in the unenviable position of needing to accept a parameter and then check its type.
-
-
Field Summary
-
Fields inherited from class com.oracle.bmc.io.internal.KeepOpenInputStream
innerStream
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description DuplicatableKeepOpenInputStream(InputStream is)Creates a KeepOpenInputStream while retaining its marking as a DuplicatableInputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamduplicate()Produces a duplicate stream of the source (from its start) that can be used in parallel to the original stream (ie, thread safe).-
Methods inherited from class com.oracle.bmc.io.internal.KeepOpenInputStream
close, closeStream, doClose
-
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
-
DuplicatableKeepOpenInputStream
public DuplicatableKeepOpenInputStream(InputStream is)
Creates a KeepOpenInputStream while retaining its marking as a DuplicatableInputStream- Parameters:
is- The DuplicatableInputStream that will be kept open. This is checked with instanceof.
-
-
Method Detail
-
duplicate
public InputStream duplicate()
Description copied from interface:DuplicatableInputStreamProduces a duplicate stream of the source (from its start) that can be used in parallel to the original stream (ie, thread safe).- Specified by:
duplicatein interfaceDuplicatableInputStream- Returns:
- A new input stream instance.
-
-