流的技术总结

    流技术总结

 

一 流的分类   

  •     1.按照数据的流向不同可分为输入流和输出流。

  •     2.按照数据单位不同可分为字节流和字符流。

  •     3.按功能不同可分为节点流和处理流。

二 主要接口

  1.   Inputstream: 表示所有字节类输入流的超类;

  2.  Outputstream:表示所有字节输出流的超类;

  3. 节点流:可以从一个特定的数据源(节点)读取数据;

  4. 处理流:是连接在已存在的流(节点流或处理流)之上,通过对数据的处理为程序提供跟那个强大的读写功能;

    File类中的主要常用方法

    1.        File.canwrite() ----是否可写;

    2.        File.exists()----是否存在;

    3.        File.canRead()----是否可写;

    4.        File.length()----字节长度;

    5.        File.lastModified()----修改的时间,返回一个lang型的数据;

    6.        File.isDirectory()----是否是一个目录;

    7.        File.isFile()----是否为标准文件;

    InputSteam的基本用法

    1.      Int  read()throws ToException

    2.      Void  close() throws IoException

    3.      Int  read(byte[] buffer) throws IoException;

    4.      Int  read(byte[] buffer, int off,int len) throws IoException;

     

    OutputSteam的基本用法

    1.        Int   weite()  throws ToException

    2.        Void  close() throws IoException

    3.        Int  weite() (byte[]  buffer) throws IoException;

    4.        Int  weite() (byte[]  buffer, int off,int len) throws IoException;

    5.        Void flush()  throws IoException;

    reader的基本用法

    1.        Int  read()throws ToException

    2.        Void  close() throws IoException

    3.        Int  read(byte[] buffer) throws IoException;

    4.        Int  read(byte[] buffer, int off,int len) throws IoException;

    writer的基本用法

    1.        Int   weite()  throws ToException

    2.        Void  close() throws IoException

    3.        Int  weite() (byte[]  buffer) throws IoException;

    4.        Int  weite() (byte[]  buffer, int off,int len) throws IoException;

    5.        Void flush()  throws IoException;

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值