package com.shrimpking.t5;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
/**
* Created by IntelliJ IDEA.
*
* @Author : Shrimpking
* @create 2024/9/23 11:38
*/
//ch17-3
public class SerDemo2
{
public static void main(String[] args) throws IOException, ClassNotFoundException
{
File f = new File("d:\\test\\SerTest.txt");
InputStream input = new FileInputStream(f); //文件输入流
ObjectInputStream ois = new ObjectInputStream(input); //对象输入流
Object obj = ois.readObject();
ois.close();
System.out.println(obj);
}
}