Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

using input stream to find bytes signifying jpeg files  RSS feed

June Rodriguez
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there. have a raw data file which is basically a corrupt media card that cannot be read by the computer. what I need to do is read the bytes and seperate the jpeg files. Jpeg files start with 255, 216, 255, and 255 or 244. I am trying to read in the raw file, look for the start of a jpeg file and, when I get to the start of the next jpeg file, save the previous stream of bytes as a jpeg. This should continue until the bytes have all been read and all the available images have been saved as individual files to the default directory.

At this point I think I have determined there are five images, but I'm not sure how to grab the chunk of each individual file and save them incrementally (split out and save the pictures into different files so they can be viewed) Any help would be appreciated.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!