zizi21
asked on
Encoding and decoding images in java
Hi there,
I have a code that teaches me (from the web) to encode and decode strings. I really need help to decode a string into image or image to string...any help is appreciated... htanks a lot...
----
import org.apache.commons.codec.b inary.Base 64;
public class Codec {
public static void main(String[] args) {
try {
String clearText = "Hello world";
String encodedText;
// Base64
encodedText = new String(Base64.encodeBase64 (clearText .getBytes( )));
System.out.println("Encode d: " + encodedText);
System.out.println("Decode d:"
+ new String(Base64.decodeBase64 (encodedTe xt.getByte s())));
//
// output :
// Encoded: SGVsbG8gd29ybGQ=
// Decoded:Hello world
//
}
catch (Exception e) {
e.printStackTrace();
}
}
}
---
I have a code that teaches me (from the web) to encode and decode strings. I really need help to decode a string into image or image to string...any help is appreciated... htanks a lot...
----
import org.apache.commons.codec.b
public class Codec {
public static void main(String[] args) {
try {
String clearText = "Hello world";
String encodedText;
// Base64
encodedText = new String(Base64.encodeBase64
System.out.println("Encode
System.out.println("Decode
+ new String(Base64.decodeBase64
//
// output :
// Encoded: SGVsbG8gd29ybGQ=
// Decoded:Hello world
//
}
catch (Exception e) {
e.printStackTrace();
}
}
}
---
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:)