Code example for ByteArrayOutputStream

Methods: size, toByteArray

0
    { 
        onStartResultProcessing(); 
        ByteArrayOutputStream bytearrayoutputstream = (ByteArrayOutputStream)getOutputStream();
        try 
        { 
            byte abyte0[] = bytearrayoutputstream.toByteArray();
            mBitmap = BitmapFactory.decodeByteArray(abyte0, 0, abyte0.length);
            return; 
        } 
        catch(OutOfMemoryError outofmemoryerror)
        { 
            Log.w("HttpTransaction", (new StringBuilder("DownloadImageOperation OutOfMemoryError on image bytes: ")).append(bytearrayoutputstream.size()).toString(), outofmemoryerror);
        } 
        throw new ProtocolException("Cannot handle downloaded image"); 
    } 
}