public class ReadOrWriteObject {
private FileInputStream fileIns = null ;//文件输入流
private FileOutputStream fileOts = null;//文件输出流
private ObjectInputStream objectIns = null ;//对象输入流
private ObjectOutputStream objectOts = null ;//对象输出流
private String fileName = null;//待处理的文件名
public static Boolean FileRead = true ;
public static Boolean FileWrite = false ;
/**
*
* @param fileName:文件名
*/
public ReadOrWriteObject(String fileName){
this.fileName = fileName ;
}
/**
* 创建对象之后,首先必须以某种方式打开文件,如读的方式,或者写的方式
* @param fileName: The name of the file.
* @param bool: Whether the file read or write.如 FileRead or FileWrite
* @return
*/
public Boolean openFile(Boolean bool){
if(bool)//if bool is true,the file is read.
{
try {
this.fileIns = new FileInputStream(this.fileName);
this.objectIns = new O
Java把double数据写入文件中
最新推荐文章于 2022-07-06 13:39:11 发布