`
小网客
  • 浏览: 1211589 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Java之IO字节流和字符流

    博客分类:
  • Java
 
阅读更多

Java中的IO分为两大线,字节流和字符流

字节流基类:InputStream/OutputStream 操作byte[]的

I部分:

public abstract int read() throws IOException;

 

O部分:

public abstract void write(int b) throws IOException;

 

字符流基类:Reader/Writer 操作char[]的

I部分:

abstract public void close() throws IOException;
abstract public int read(char cbuf[], int off, int len) throws IOException;

O部分:

abstract public void write(char cbuf[], int off, int len) throws IOException;
abstract public void flush() throws IOException;
abstract public void close() throws IOException;

 

转换桥梁:

InputStreamReader和OutputStreamWriter

 

0
2
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics