com.octo.android.robospice.request.simple
Class BitmapRequest
java.lang.Object
com.octo.android.robospice.request.SpiceRequest<android.graphics.Bitmap>
com.octo.android.robospice.request.simple.BitmapRequest
- All Implemented Interfaces:
- IBitmapRequest, Comparable<SpiceRequest<android.graphics.Bitmap>>
public class BitmapRequest
- extends SpiceRequest<android.graphics.Bitmap>
- implements IBitmapRequest
Downloads big images in size as bitmaps. All data is passed to the listener
using file system.
- Author:
- sni
Constructor Summary |
BitmapRequest(String url,
android.graphics.BitmapFactory.Options options,
File cacheFile)
Creates a BitmapRequest able to fetch a Bitmap from the network. |
BitmapRequest(String url,
File cacheFile)
Creates a BitmapRequest able to fetch a Bitmap from the network. |
BitmapRequest(String url,
int width,
int height,
File cacheFile)
Creates a BitmapRequest able to fetch a Bitmap from the network. |
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 |
BitmapRequest
public BitmapRequest(String url,
File cacheFile)
- Creates a BitmapRequest able to fetch a
Bitmap
from the network.
- Parameters:
url
- the url of the bitmap to fetch.cacheFile
- a file used to store data during download.
BitmapRequest
public BitmapRequest(String url,
android.graphics.BitmapFactory.Options options,
File cacheFile)
- Creates a BitmapRequest able to fetch a
Bitmap
from the network.
- Parameters:
url
- the url of the bitmap to fetch.options
- used to decode the data received from the network.cacheFile
- a file used to store data during download.
BitmapRequest
public BitmapRequest(String url,
int width,
int height,
File cacheFile)
- Creates a BitmapRequest able to fetch a
Bitmap
from the network.
- Parameters:
url
- the url of the bitmap to fetch.width
- the requested width of the image.height
- the requested height of the image.cacheFile
- a file used to store data during download.
loadDataFromNetwork
public android.graphics.Bitmap loadDataFromNetwork()
throws Exception
- Specified by:
loadDataFromNetwork
in interface IBitmapRequest
- Specified by:
loadDataFromNetwork
in class SpiceRequest<android.graphics.Bitmap>
- Throws:
Exception
getUrl
protected final String getUrl()
getCacheFile
public File getCacheFile()
- Specified by:
getCacheFile
in interface IBitmapRequest
processStream
public void processStream(int contentLength,
InputStream inputStream)
throws IOException
- Throws:
IOException
readBytes
protected void readBytes(InputStream in,
ProgressByteProcessor processor)
throws IOException
- Inspired from Guava com.google.common.io.ByteStreams
- Throws:
IOException
Copyright © 2012-2014. All Rights Reserved.