Name: diC59631 Date: 07/22/98
Hi
The below code proceduces the following exception "sun.misc.CEFFormatException: UUDecoder: Missing 'end' line."
import sun.misc.*;
import java.io.*;
public class UUTest {
public static void main(String[] args) throws IOException {
// text to encode and decode
String originalText = "Hi There, please encode and decode me";
// turn the string into a byte array
byte[] originalBytes = originalText.getBytes();
// create all the encoders and decoders for later use
UUEncoder uuE = new UUEncoder();
UUDecoder uuD = new UUDecoder();
System.out.println("Orignl *" + originalText + "*");
System.out.println("===========UU encoding Start================");
// do UU stuff
System.out.println();
String uuEnc = uuE.encodeBuffer(originalBytes);
System.out.println(uuEnc);
System.out.println("===========UU encodeing Ends=================");
// this will fail, Why?
String uuDec = new String(uuD.decodeBuffer(uuEnc));
System.out.println("Decode *" + uuDec + "*");
}
}
(Review ID: 27260)
======================================================================