序列化对象的文件扩展名
2022-09-02 01:02:43
将对象保存到磁盘时,哪种文件扩展名最合适?Serializable
FileOutputStream fos = null;
ObjectOutputStream out = null;
try {
fos = new FileOutputStream(filename);
out = new ObjectOutputStream(fos);
out.writeObject(mySerializableObject);
} catch (IOException ex) {
ex.printStackTrace();
} finally {
IOUtils.closeQuietly(out);
}