public class StreamChunkCreator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StreamChunkCreator.DuplicatedSubRangeInputStream
Creates a new duplicated SubRangeInputStream.
|
static class |
StreamChunkCreator.SubRangeInputStream
Creates a new SubRangeInputStream that represents a sub-range of bytes from another InputStream.
|
Constructor and Description |
---|
StreamChunkCreator(InputStream stream,
long contentLength,
long chunkLength) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasMore()
Test for whether or not there are any more chunks that can be created.
|
StreamChunkCreator.SubRangeInputStream |
next()
Returns the next chunk as a new stream.
|
boolean |
supportsParallelReads()
Test for whether or not the input stream can be read in parallel.
|
public StreamChunkCreator(InputStream stream, long contentLength, long chunkLength)
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 by next()
must be read from serially.
public boolean hasMore()
Test for whether or not there are any more chunks that can be created.
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.
Copyright © 2016–2022. All rights reserved.