12-20-2010 10:55 AM
plz go on this thead and give me answer
how we can make chunks.
This question is not related to this post so that's why refring other thread.
12-20-2010 12:58 PM
Apologies, I don't like the code because it does seem to introduce the possibility of a byte to String conversion, but the way you have coded it, this does not happen.
However I suspect the following is more efficient and uses less memory, since it converts from byte to byte (avoiding the byte to char, then to String, then to byte).
byte b = YourBase64EncodedString.getBytes();
byte _raw = decodeBase64(b, 0, b.length);
Bitmap _image = Bitmap.createBitmapFromBytes( _raw, 0, -1, 1 );
// Decodes the given byte array from Base64.
// Offset and length specify which part of the array to decode.
// The decoded data is returned as a byte array.
public static byte  decodeBase64( byte toDecode, int offset, int length )
// Create the input byte array to pass in the content.
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( toDecode, offset, length );
// Create the base64 input stream.
Base64InputStream base64InputStream = new Base64InputStream(byteArrayInputStream);
byte  returnBytes = IOUtilities.streamToBytes(base64InputStream);
01-22-2013 04:39 PM
I think you are in the wrong forum.
Have a look at the possibilitities here:
and choose a BB10 related forum for the question.