千峰JAVA第31天作业

在千峰第31天
“汗水是人生齿轮的润滑油”
中国加油,武汉加油,千峰加油,我自己加油。
3、
输入
字节
节点
4、
int 从这个输入流读取一个字节的数据
byte数据数组 读取文件存在一个临时数组中
byte数据数组 存入数组的下标 下标长度
5、
AC
6、
创建一个文件 追加,或覆盖
输出文件追加数据 会
7、
class TestFileinputStream{
public static void main(String[] args){ throws IOException
FileInputStream fin=new FileInputStream(“Test.txt”); //加异常声明
try{
System.out.println(fin.read());
fin.close();
}catch(Exception e){
}
}
}
8、
public class TestFileinputStream{
public static void main(String[] args) throws IOException {
FileOutputStream fos=new FileOutputStream(“Test.txt”);
FileInputStream fin=new FileInputStream(“Test.txt”);
try {
byte[] b=new byte[]{‘H’,‘e’,‘l’,‘l’,‘o’,’ ',‘W’,‘o’,‘r’,‘l’,‘d’};
fos.write(b);
for(int i=0;i<b.length;i++) {
int n=fin.read();
System.out.print((char)n);
}
}catch(Exception e) {
e.printStackTrace();
}finally {
fos.close();
fin.close();
}
}
}
13、
Serializable
transient
15、
print方法表示把对象的toString方法返回值写入流中
writeObject表示把对象信息写入流中
16、
B

发布了21 篇原创文章 · 获赞 0 · 访问量 1958

猜你喜欢

转载自blog.csdn.net/qq_40091389/article/details/104910187