java io 读写对象
来源:互联网 发布:linux 端口映射工具 编辑:程序博客网 时间:2024/04/28 19:57
<span style="font-size:14px;">private static void writeOBJ() {File file = new File("/Users/liqingfeng/Desktop/test");FileOutputStream fos;try {fos = new FileOutputStream(file);ObjectOutputStream oos = new ObjectOutputStream(fos);String str = new String("我啊你 abc123..");oos.writeObject(str);oos.close();fos.close();} catch (FileNotFoundException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();}}private static void readOBJ() {File file = new File("/Users/liqingfeng/Desktop/test");FileInputStream fis;try {fis = new FileInputStream(file);ObjectInputStream ois = new ObjectInputStream(fis);String str = (String) ois.readObject();System.out.println(str);ois.close();fis.close();} catch (FileNotFoundException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();} catch (ClassNotFoundException e) {e.printStackTrace();}}</span>
0 0
- java io 读写对象
- scala-io-读写对象
- JAVA序列化在IO中读写对象的使用
- Java IO系列(五):读写对象ObjectOutputStream和ObjectInputStream
- java使用IO对象流进行数据读写
- JAVA IO读写文件
- Java IO 读写文件
- IO读写(一) java
- JAVA-IO读写文件
- Java Io读写实例
- Java-----IO读写操作
- java IO读写文件
- Java IO读写
- Java IO 读写文件
- Java IO读写操作
- IO读写(一) java
- Java IO 读写文件
- Java IO流 读写
- Java集合总结之Collection整体框架
- iOS开发分分钟搞定C语言 —— 函数
- Google Spanner和F1介绍
- 类成员函数作为线程函数的几种方法
- [深入理解Java虚拟机]第三章 垃圾收集器及相关参数
- java io 读写对象
- 第6周项目1 - 建立顺序栈算法库
- 初学NPOI
- 学习计划
- 深入理解按位异或运算符
- iOS开发分分钟搞定C语言 —— 进制
- leetcode206 Reverse Linked List
- Allods IP
- QT5 学习之路25---画刷和画笔