二进制流转换

public static void main(String[] args) {

        try {
            //从文件地址中读取内容到程序中
            //1、建立连接
            FileInputStream fis = new FileInputStream("/Users/tan/Downloads/1.txt");
              ObjectInputStream ois = new ObjectInputStream(fis);
              Object obj = ois.readObject();
              ois.close();
        catch (FileNotFoundException e) {
 
            e.printStackTrace();
        catch (IOException e) {
            e.printStackTrace();
        catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
posted @ 2021-11-30 10:41  Laurie的老公  阅读(98)  评论(0)    收藏  举报