JAVA IO流结构图概览

整理Java IO流的关系,并作图如下,以供参考。

下图基于JDK 1.8制作,其中需要注意的是StringBufferInputStream和LineNumberInputStream已被废弃。

详情如下:

1. StringBufferInputStream

@deprecated
This class does not properly convert characters into bytes. As of JDK 1.1, the preferred way to create a stream from a string is via the StringReader class.

由于该类无法准确的将字符转换为字节,因此建议用StringReader来取代使用。

2. LineNumberInputStream

@deprecated

This class incorrectly assumes that bytes adequately represent * characters. As of JDK 1.1, the preferred way to operate on * character streams is via the new character-stream classes, which * include a class for counting line numbers.

由于该类错误地认为字节能恰当地表示字符,因此推荐使用字符流的类来取代,即LineNumberReader。

JAVA IO流结构图概览_第1张图片 Java IO流 JAVA IO流结构图概览_第2张图片 Reader JAVA IO流结构图概览_第3张图片 Writer JAVA IO流结构图概览_第4张图片 InputStream JAVA IO流结构图概览_第5张图片 OutputStream

 

你可能感兴趣的:(Java基础)