Class StreamChunkCreator.DuplicatedSubRangeInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.oracle.bmc.objectstorage.transfer.internal.StreamChunkCreator.SubRangeInputStream
-
- com.oracle.bmc.objectstorage.transfer.internal.StreamChunkCreator.DuplicatedSubRangeInputStream
-
- All Implemented Interfaces:
com.oracle.bmc.http.client.io.DuplicatableInputStream,Closeable,AutoCloseable
- Enclosing class:
- StreamChunkCreator
public static class StreamChunkCreator.DuplicatedSubRangeInputStream extends StreamChunkCreator.SubRangeInputStream implements com.oracle.bmc.http.client.io.DuplicatableInputStream
Creates a new duplicated SubRangeInputStream.This individual sub range can be duplicated multiple times (ex, for retries).
This class should be used in place of
StreamChunkCreator.SubRangeInputStreamdirectly when the underlying input stream itself is a DuplicatableInputStream. This class will always duplicate the underlying stream while maintaining the desired start and end positions.Because this stream can be duplicated for each thread, it will support
InputStream.mark(int)andInputStream.reset()whenever the source stream does so, because only one thread will reset it, and the threads will not interfere with each other.
-
-
Field Summary
-
Fields inherited from class com.oracle.bmc.objectstorage.transfer.internal.StreamChunkCreator.SubRangeInputStream
currentStartPositionInSource, source
-
-
Constructor Summary
Constructors Constructor Description DuplicatedSubRangeInputStream(com.oracle.bmc.http.client.io.DuplicatableInputStream source, long desiredStartPositionInSource, long desiredEndPositionInSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamduplicate()voidmark(int readlimit)booleanmarkSupported()voidreset()-
Methods inherited from class com.oracle.bmc.objectstorage.transfer.internal.StreamChunkCreator.SubRangeInputStream
available, close, length, read, read
-
Methods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, transferTo
-
-
-
-
Method Detail
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
duplicate
public InputStream duplicate()
- Specified by:
duplicatein interfacecom.oracle.bmc.http.client.io.DuplicatableInputStream
-
-