public class ChunkStreamer extends Object
Constructor and Description |
---|
ChunkStreamer(HapiService service,
int chunkLimit,
IOConsumer<String> limitCallback)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getChunkLimit()
Returns the largest number of chunks that this streamer is prepared
to request for a given download.
|
InputStream |
openMultiChunkStream(URL requestUrl)
Returns an input stream corresponding to the supplied HAPI data request
URL, but which may be assembled from the concatenation of
multiple actual requests to the service.
|
public ChunkStreamer(HapiService service, int chunkLimit, IOConsumer<String> limitCallback)
A limit must be supplied for the maximum number of chunks that will be retrieved for a given request. If this limit is exceeded, the supplied callback object, if any, will be called and the stream will terminate. If the callback throws an IOException, it will be encountered by the code reading the stream.
service
- service to which requests will be madechunkLimit
- maximum number of chunks that a data stream will
includelimitCallback
- called with a failure message
if chunk limit is exceeded; may be nullpublic int getChunkLimit()
public InputStream openMultiChunkStream(URL requestUrl) throws IOException
requestUrl
- data request URLIOException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.