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.SubRangeInputStream
directly 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)
and InputStream.reset()
whenever the source stream does so,
because only one thread will reset it, and the threads will not interfere with each other.
currentStartPositionInSource, source
Constructor and Description |
---|
DuplicatedSubRangeInputStream(com.oracle.bmc.http.client.io.DuplicatableInputStream source,
long desiredStartPositionInSource,
long desiredEndPositionInSource) |
Modifier and Type | Method and Description |
---|---|
InputStream |
duplicate() |
void |
mark(int readlimit) |
boolean |
markSupported() |
void |
reset() |
available, close, length, read, read
read, skip
public DuplicatedSubRangeInputStream(com.oracle.bmc.http.client.io.DuplicatableInputStream source, long desiredStartPositionInSource, long desiredEndPositionInSource)
public boolean markSupported()
markSupported
in class InputStream
public void mark(int readlimit)
mark
in class InputStream
public void reset() throws IOException
reset
in class InputStream
IOException
public InputStream duplicate()
duplicate
in interface com.oracle.bmc.http.client.io.DuplicatableInputStream
Copyright © 2016–2024. All rights reserved.