Class 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.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.

    • Constructor Detail

      • DuplicatedSubRangeInputStream

        public DuplicatedSubRangeInputStream​(com.oracle.bmc.http.client.io.DuplicatableInputStream source,
                                             long desiredStartPositionInSource,
                                             long desiredEndPositionInSource)