Class StreamChunkCreator
- java.lang.Object
-
- com.oracle.bmc.objectstorage.transfer.internal.StreamChunkCreator
-
public class StreamChunkCreator extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStreamChunkCreator.DuplicatedSubRangeInputStreamCreates a new duplicated SubRangeInputStream.static classStreamChunkCreator.SubRangeInputStreamCreates a new SubRangeInputStream that represents a sub-range of bytes from another InputStream.
-
Constructor Summary
Constructors Constructor Description StreamChunkCreator(InputStream stream, long contentLength, long chunkLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasMore()Test for whether or not there are any more chunks that can be created.StreamChunkCreator.SubRangeInputStreamnext()Returns the next chunk as a new stream.booleansupportsParallelReads()Test for whether or not the input stream can be read in parallel.
-
-
-
Constructor Detail
-
StreamChunkCreator
public StreamChunkCreator(InputStream stream, long contentLength, long chunkLength)
-
-
Method Detail
-
supportsParallelReads
public boolean supportsParallelReads()
Test for whether or not the input stream can be read in parallel.If this returns true, then streams returned by
next()are safe to be read from in parallel. If this returns false, then streams returned bynext()must be read from serially.- Returns:
- true if parallel reads could be enabled, false if they could not.
-
hasMore
public boolean hasMore()
Test for whether or not there are any more chunks that can be created.- Returns:
- true if there are additional chunks, false if all done
-
next
public StreamChunkCreator.SubRangeInputStream next()
Returns the next chunk as a new stream.Returned streams must be consumed in order unless
supportsParallelReads()returned true, in which case the returned streams can be read out of order.Users should call
hasMore()before calling this.- Returns:
- The next chunk.
-
-