com.octo.android.robospice.request.simple
Class BinaryRequest
java.lang.Object
com.octo.android.robospice.request.SpiceRequest<InputStream>
com.octo.android.robospice.request.simple.BinaryRequest
- All Implemented Interfaces:
- Comparable<SpiceRequest<InputStream>>
- Direct Known Subclasses:
- BigBinaryRequest, SmallBinaryRequest
public abstract class BinaryRequest
- extends SpiceRequest<InputStream>
Abstract class used to download binaries. See SmallBinaryRequest
and
BigBinaryRequest
- Author:
- jva
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 |
url
protected String url
BinaryRequest
public BinaryRequest(String url)
loadDataFromNetwork
public final InputStream loadDataFromNetwork()
throws Exception
- Specified by:
loadDataFromNetwork
in class SpiceRequest<InputStream>
- Throws:
Exception
getUrl
protected final String getUrl()
processStream
public abstract InputStream processStream(int contentLength,
InputStream inputStream)
throws IOException
- Override this method to process the stream downloaded
- Parameters:
contentLength
- size of the downloadinputStream
- stream of the download
- Returns:
- an inputstream containing the download
- 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.