Java中的IO流
2021-07-03 本文已影响0人
CodingDGSun
Java中的IO流分类
- 输入IO流
- 输入字节流(InputStream)
- 处理流
- 缓冲流(BufferedInputStream)
- 转换流
- 数据流(DataInputStream)
- 标准流(System.in(InputStream))
- 处理流
- 输入字符流(Reader)
- 处理流
- 缓冲流(BufferedReader)
- 转换流(InputStreamReader)
- 数据流
- 标准流
- 处理流
- 输入字节流(InputStream)
UML关系图如下所示
PantUML语法
A <|-- B //B继承A
C <|... D //D实现了C
@startuml
abstract class InputStream{
}
class BufferedInputStream{
}
class FilterInputStream{
}
class DataInputStream{
}
interface DataInput{
}
abstract class Reader{
}
class BufferedReader{
}
class InputStreamReader{
}
FilterInputStream <|-- BufferedInputStream
InputStream <|-- FilterInputStream
FilterInputStream <|-- DataInputStream
DataInput <|.. DataInputStream
Reader <|-- BufferedReader
Reader <|-- InputStreamReader
@enduml
15_01
- 输出IO流
-
输出字节流(OutputStream)
- 处理流
- 缓冲流(BufferedOutputStream)
- 转换流
- 数据流(DataOutputStream)
- 标准流(System.out(PrintStream))
- 处理流
-
输出字符流(Writer)
- 处理流
- 缓冲流(BufferedWriter)
- 转换流(OutputStreamWriter)
- 数据流
- 标准流(PrintWriter)
- 处理流
-
UML关系图如下所示
PantUML语法
A <|-- B //B继承A
C <|... D //D实现了C
@startuml
abstract class OutputStream{
}
class BufferedOutputStream{
}
class FilterOutputStream{
}
class DataOutputStream{
}
class PrintStream{
}
abstract class Writer{
}
class BufferedWriter{
}
class OutputStreamWriter{
}
class PrintWriter{
}
FilterOutputStream <|-- BufferedOutputStream
OutputStream <|-- FilterOutputStream
FilterOutputStream <|-- DataOutputStream
DataOutput <|.. DataOutputStream
FilterOutputStream <|-- PrintStream
Writer <|-- BufferedWriter
Writer <|-- OutputStreamWriter
Writer <|-- PrintWriter
@enduml
15_02