In applet its very simple to do this
BufferedImage originalImage = ImageIO.read(new File("c:\\image\\mypic.jpg"));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write( originalImage, "jpg", baos );
baos.flush();
byte[] imageInByte = baos.toByteArray();
baos.close()
ByteBuffer buf = ByteBuffer.wrap(imageInByte);
1 comment:
Excelent! work for me!!!!
Post a Comment