このコードは動いたよ
-----------------
File f = File.createTempFile ("___oos_out", null);
f.deleteOnExit ();
//
OutputStream fos = new FileOutputStream (f);
ObjectOutputStream oos = new ObjectOutputStream (fos);
DataOutputStream dos = new DataOutputStream (oos);
dos.writeUTF ("Hello!");
oos.writeInt (12345);
dos.writeInt (54321);
oos.writeUTF ("Good-bye!");
dos.close ();
//
InputStream fis = new FileInputStream (f);
ObjectInputStream ois = new ObjectInputStream (fis);
DataInputStream dis = new DataInputStream (ois);
System.out.println (dis.readUTF ());
System.out.println (ois.readInt ());
System.out.println (dis.readInt ());
System.out.println (ois.readUTF ());
dis.close ();
-----------------