import java.awt.*; import java.awt.image.*; import javax.imageio.*; import java.io.*; /** *
Title: ImageConverter
* * * @author Sangyoon Oh * @version 0.0 */ public class ImageConverter implements ImageReceiver { int count = 0; public void onMessage(byte[] image) { count++; try { File file = new File("C:\\Captured" + count + ".jpg"); if(image.length >= 0) { BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file)); out.write(image); out.close(); } } catch (IOException ioe) { ioe.printStackTrace(); } } }