-1

I am working on a project. It is about capturing photos from the PC and monitoring them on an Android phone screen.

I use JpegEncoder or ImageIO classes from the PC side and on the Android side I use BitmapFactory.decodeStream method. When I send one image it works well but I need to send images continuously (2 or 3 images per second). It does not work in a while loop.

In logchat view it shows this error message until I close the Android application:

 SkImageDecoder : Factory returned null

I think the problem is about cursor position in stream from ImageIO code side the ImageIO.write(img,"jpg",ostream) methot flushes stream after every sent but Android side BitmapFactory.decodeBitmap() does not flush after every reading so the error is SkImageDecoder returned null

daemonThread
  • 243
  • 2
  • 12

1 Answers1

0

Take a look at this question, you may find an answer for yourself too

BitmapFactory.decodeStream(InputStream is) returns null for non null InputStream on Android

Community
  • 1
  • 1
ilhan çetin
  • 383
  • 5
  • 19
  • as well as i understood it is not about my problem because i can load image succesfully when i sent only one Image so it looks there is no problem while reading stream bytes so dont need to skip method brother. Thanks for advice – daemonThread Jan 18 '12 at 22:27