If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Decoding error creating String from Image

I see that there is a limit with Base64.decode:

 

http://supportforums.blackberry.com/t5/Java-Development/Limit-on-the-input-size-for-Base64InputStrea...

 

So your stream code should get round this issue.

 

Can you tell me how you are getting on with my comment that the logic is not correct?

Please use plain text.
Contributor
elmar28
Posts: 16
Registered: ‎01-27-2013
My Device: blackberry9360
My Carrier: docomo

Re: Decoding error creating String from Image

Is slow reply.

 

data = Base64OutputStream encode (. dataEncoded, 0, dataEncoded length, false, false);

 

It was no good I tried this(b).

I catch the same error.

 

ByteArrayInputStream bis = new ByteArrayInputStream(m_RawData, iFileStart, iLen);
Base64InputStream b64 = new Base64InputStream(bis);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buff = new byte[1024]; // faster than byte-at-a-time
for (int len = b64.read(buff); len != -1; len = b64.read(buff)) {
bos.write(buff, 0, len);
}
bDecodedFile = bos.toByteArray();

I was spoiled already try this code.

 

Large size of image data normally stored the how is the best?

 

data:image/png;base64,

 

I want to teach you how to properly save files in this format.

Please use plain text.
Contributor
elmar28
Posts: 16
Registered: ‎01-27-2013
My Device: blackberry9360
My Carrier: docomo

Re: Decoding error creating String from Image

I have found the source of restriction.
I think there is a limit to pass as an argument to a function by ivoke.

 

 

Please use plain text.