Sounds like you want OCR (Optical Character Recognition) to convert an image to text. There are already programs for that and it would be very difficult to write in Java (or any other language for that matter).
thanks for the reply..
I need java code to convert image into text and the text into image..
i am trying with this code. import java.awt.image.BufferedImage;
As Pawel mentioned, you'll probably want to use base64 to encode/decode binary data.
First off, you haven't made it clear why you want text. Why not just copy the image file as binary data?
So, assuming text is what you want, base64 will encode binary data (in your case an image) into text data. There's no need to use BufferedImage, you already have an image file (.jpg) in binary format, just read the file and encode it, it doesn't matter if the binary data represents an image or not.