com.octo.android.robospice.request.simple
Class BigBinaryRequest
java.lang.Object
com.octo.android.robospice.request.SpiceRequest<InputStream>
com.octo.android.robospice.request.simple.BinaryRequest
com.octo.android.robospice.request.simple.BigBinaryRequest
- All Implemented Interfaces:
- Comparable<SpiceRequest<InputStream>>
public class BigBinaryRequest
- extends BinaryRequest
Downloads big images in size. All data is passed to the listener using file
system. This class is meant to help download big images. If you wish to
download smaller documents, you would be better using
SmallBinaryRequest
.
- Author:
- sni & jva
Fields inherited from class com.octo.android.robospice.request.simple.BinaryRequest |
url |
Constructor Summary |
BigBinaryRequest(String url,
File cacheFile)
Creates a BigBinaryRequest using its own cache file to prevent any downloaded data to be stored in memory. |
Methods inherited from class com.octo.android.robospice.request.SpiceRequest |
cancel, compareTo, getPriority, getResultType, getRetryPolicy, isAggregatable, isCancelled, publishProgress, publishProgress, setAggregatable, setFuture, setPriority, setRequestCancellationListener, setRequestProgressListener, setRetryPolicy |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cacheFile
protected File cacheFile
BigBinaryRequest
public BigBinaryRequest(String url,
File cacheFile)
- Creates a BigBinaryRequest using its own cache file to prevent any downloaded data to be stored in memory.
All file received from the network (via a simple http GET request) will be stored directly in the cache file to prevent memory loss.
- Parameters:
url
- the url to get the image data from.cacheFile
- a file used to store image data. Developers will have to handle the cache file erasure by themselves.
This cache file is not handled by RS caching mechanism in the "normal way".
processStream
public InputStream processStream(int contentLength,
InputStream inputStream)
throws IOException
- Description copied from class:
BinaryRequest
- Override this method to process the stream downloaded
- Specified by:
processStream
in class BinaryRequest
- Parameters:
contentLength
- size of the downloadinputStream
- stream of the download
- Returns:
- an inputstream containing the download
- Throws:
IOException
getCacheFile
public File getCacheFile()
Copyright © 2012-2014. All Rights Reserved.