【初心者】Java質問・相談スレ8【大歓迎】
■ このスレッドは過去ログ倉庫に格納されています
0348デフォルトの名無しさん
NGNG---------------
String filename = "__oos_out.dat";
FileOutputStream fos = new FileOutputStream (filename);
ObjectOutputStream oos = new ObjectOutputStream (fos);
DataOutputStream dos = new DataOutputStream (oos);
dos.writeInt (12345);
dos.writeUTF ("Hello!");
dos.close ();
//
FileInputStream fis = new FileInputStream (filename);
ObjectInputStream ois = new ObjectInputStream (fis);
DataInputStream dis = new DataInputStream (ois);
System.out.println (dis.readInt ());
System.out.println (dis.readUTF ());
dis.close ();
---------------
12345
Hello!
---------------
■ このスレッドは過去ログ倉庫に格納されています