Kaffe seems to create a zero byte file, presumably because it doesn't flush the ObjectOutputStream. Sun happens to do that, that's why your code works there. I'd say that's just by accident, but we will of course investigate and find out why Kaffe fails or whether the spec says writeObject must flush the underlying stream. For the interim, you can use oo.flush() or oo.close() before the call to os.close(). Now I tried that and now Kaffe is giving me this output: The String that was written is: `Today is: ' PST PST The Date that was written is: `May 5, 1999 10:31:07 AM PDT' (I added the single apostrophes. This output is correct, except for the mysterious "PST"s that pop up [ a side effect of Date.toString()?] ) The 'PST' look like some forgotten debug statement somewhere in Kaffe's libraries. In addition, it's wrong. Tim's on PDT, but I'm on MDT. If I invoke it with -Duser.timezone=MDT, it tells me: The String that was written is: `Today is: ' GMT The Date that was written is: `May 5, 1999 5:58:04 PM GMT+0:00' Now the "GMT" is superflous. I guess you're either in California or in England. Thanks for the report though. Btw, it is always a good idea to file a bug report with Kaffe's jitterbug bug database (www.kaffe.org), especially if you have a reproducible testcase that fails. - Godmar > > Hi Everybody > > I downloaded Kaffe and today I made my first test. > I have an example of Serialization that works fine, but with Kaffe > doesn't. Should I use anything especial? > Thanks in advance > > Ivana > > Here is the source code: > > /////////////////////////////////////////////////////// > import java.io.*; > import java.util.*; > > class ObjectSerialization { > public static void main(String[] args) { > WR wr = new WR(); > wr.write(); > wr.read(); > } > } > > class WR { > > FileOutputStream os = null; > ObjectOutput oo = null; > FileInputStream is = null; > ObjectInput oi = null; > > WR() {}; > > // write an object > public void write() { > Date d = new Date(); > try { > os = new FileOutputStream("SavedObject"); > oo = new ObjectOutputStream(os); > } catch ( Exception e ) { > System.out.println(e); > System.out.println("WRITE: Unable to open stream > as an obj > ect stream"); > } > try { > oo.writeObject("Today is: "); > oo.writeObject(d); > os.close(); > } catch ( Exception e ) { > System.out.println(e); > System.out.println("Unable to write Objects"); > } > > > // read an object > public void read() { > try { > is = new FileInputStream("SavedObject"); > oi = new ObjectInputStream(is); > } catch ( Exception e ) { > System.out.println("READ: Unable to open stream > as an object stream"); > } > Date d = null; > String str = null; > try { > str = (String)oi.readObject(); > d = (Date)oi.readObject(); > } catch ( Exception e ) { > System.out.println("Unable to read Object"); > } > System.out.println("The String that was written is: " + > str); > System.out.println("The Date that was written is: " + > d); > } > > } > > //////////////////////////////////////////////////// >