Search in sources :

Example 6 with ProgressByteProcessor

use of com.octo.android.robospice.request.ProgressByteProcessor in project robospice by stephanenicolas.

the class SmallBinaryRequest method processStream.

@Override
public InputStream processStream(final int contentLength, final InputStream inputStream) throws IOException {
    final ByteArrayOutputStream bos = new ByteArrayOutputStream();
    readBytes(inputStream, new ProgressByteProcessor(this, bos, contentLength));
    final byte[] bytes = bos.toByteArray();
    return new ByteArrayInputStream(bytes);
}
Also used : ProgressByteProcessor(com.octo.android.robospice.request.ProgressByteProcessor) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream)

Aggregations

ProgressByteProcessor (com.octo.android.robospice.request.ProgressByteProcessor)6 FileOutputStream (java.io.FileOutputStream)4 OutputStream (java.io.OutputStream)4 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 FileInputStream (java.io.FileInputStream)2