- 四大抽象类
字符流:
Reader
Writer
字节流:
InputStream(输入数据)
OutputStream(输出数据)
- 输入流
InputStream的基本方法int read()throws IOException
//读取一个字节以整数形式返回,如果返回-1已到输入流的末尾
voidclose()throws IOException
//关闭流释放内存资源
longskip(long n)throws IOException
//跳过n个字节不读
- 输出流
OutputStream的基本方法voidwrite(int b)throws IOException
//向输出流写入一个字节数据
voidflush()throws IOException
//将输出流中缓冲的数据全部写出到目的地
- Writer
Writer的基本方法void write(int c)throws IOException
//向输出流写入一个字符数据
void write(String str)throws IOException
//将一个字符串中的字符写入到输出流
void write(String str,int offset,int length)
//将一个字符串从offset开始的length个字符写入到输出流
void flush()throws IOException
//将输出流中缓冲的数据全部写出到目的地
- Reader
Reader的基本方法int read()throws IOException
//读取一个字符以整数形式返回,如果返回-1已到输入流的末尾