JPG-Decompression in Java

Hello

I want to send JPG-Pictures with a Socket-Stream to an Applet!! (Byte-Arrays)

But I have no Idea, how I can decode the Picture in Memory.

thanx for help

:-)
      Dennis

Please help
merAsked:
Who is Participating?
 
fontaineConnect With a Mentor Commented:
I think you have here what yu need:

http://lcavwww.epfl.ch/demos/jpeg.html
0
 
evijayCommented:
You draw the image on an offscreen canvas which you create on the server side (program which uses ServerSocket), use pixelgrabber class to get the bytes of the image, send the image to applet. In the applet side, use MemoryImageSource to construct back the Image from array of bytes and display the image where ever you want.
0
 
evijayCommented:
You can also read the jpeg image file as byte stream, send it to the applet, applet uses Toolkit.getDefaultToolkit().createImage(byte[] imagedata) method to create the Image back and display

0
 
evijayCommented:
The createImage method understands the byte array format to be either gif or jpeg and handles appropriately

0
All Courses

From novice to tech pro — start learning today.