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

New Developer
Posts: 11
Registered: ‎08-21-2009
My Device: Not Specified

Reading Gallery images on OS 5 beta 4 - new issue?

In OS 4.x, I had the following code that would read in images from the default pictures directory. It worked fine:



FileConnection fileConn = (FileConnection)Connector.open(file);InputStream input = fileConn.openInputStream(); // TODO: available now returns 0 bytes. Why?int available = input.available();byte[] encodedData = new byte[available];input.read(encodedData, 0, available);


The available size now returns 0 bytes so, of course, the read doesn't actually read anything. Is this a new bug in OS 5 or was there some change that I'm not yet aware of? Is there some new setting I need to configure? 


Thanks for any info or insight!