×
Namespaces

Variants
Actions

Talk:How to read an image from Gallery in Java ME

From Nokia Developer Wiki
Jump to: navigation, search

Error in the code

The line:

is.read(bytes, 0, size);

Should read:

int bytesRead = 0;
while (bytesRead < size) {
bytesRead += is.read(bytes, bytesRead, size - bytesRead);
}

InputStream.read() does not necessarily read as many bytes as you want.

Unfortunately, the file is locked and I can't fix it!

 
×