千峰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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值