[2551] in java-interest

home help back first fref pref prev next nref lref last post

CEFormatError ...why?

daemon@ATHENA.MIT.EDU (satoh-HAL-osamu)
Wed Oct 4 10:07:54 1995

From: pfu.fujitsu.co.jp!satoo@fujitsuI.fujitsu.com (satoh-HAL-osamu)
To: java-interest@java.Eng.Sun.COM
Date: Wed, 04 Oct 1995 20:55:50 +0900

Hi folks,

I'm struggling with UUDecoder now.
I wrote a class:

--- beggining of source
import java.io.*;
import java.util.*;

class Extract implements Enumeration {
    static String uudata[] = {
	"begin 664 extracted",
	"M/$A434P^\"CQ(14%$/@H\\5$E43$4^=&5S=\"!F;W(@97AT<F%C=\"!D871A/\"]4",
	"M251,13X*/\"](14%$/@H\\0D]$63X*2&5R92!G;V5S('1H92!A<'!L970N+BX*",
	"M/$%04\"!C;&%S<STB17AT<F%C=%1E<W0B('=I9'1H/3(P,\"!H96EG:'0],3`P",
	"3/@H\\+T)/1%D^\"CPO2%1-3#X*\"E1E",
	"`",
	"end"
    };

    int index = 0;

    Extract() {
	super();
    }

    void extract() {
	InputStream is = new InputStreamSequence(this);
	OutputStream os = new FileOutputStream("/tmp/extracted");
	(new UUDecoder()).decodeBuffer(is, os);
    }

    public boolean hasMoreElements() {
	return index < uudata.length;
    }

    public Object nextElement() {
	InputStream is = new StringInputStream(uudata[index] + "\n");
	index++;
	return is;
    }

    public static void main(String args[]) {
	(new Extract()).extract();
    }
}
---- end of source

It is successfully compiled with alpha3 version of javac.
When I run it, it creates /tmp/extracted but tells
CEFormatException has been occured. The messages displayed
are:

--- beggining of messages
java.util.CEFormatException UUDecoder: Short Buffer.
        at java.lang.Exception.<init>(Exception.java)
        at java.util.CEFormatException.<init>(CEFormatException.java)
        at java.util.UUDecoder.decodeLinePrefix(UUDecoder.java)
        at java.util.CharacterDecoder.decodeBuffer(CharacterDecoder.java)
        at Extract.extract(Extract.java:24)
        at Extract.main(Extract.java:38)
--- end of messages

The created /tmp/extracted has some gabages on the end of
the file. Why?

I'm running this on Solaris 2.4, alpha3 version of java.

Any help?

Best regards,
SATOH Osamu
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post