java中的`InputStream``DataInputStream`和`BufferedInputStream`的区别? [英] The difference of `InputStream` `DataInputStream` and `BufferedInputStream` in java?
问题描述
InputStream的差别
DataInputStream
和 BufferedInputStream
in java吗?
The difference of InputStream
DataInputStream
and BufferedInputStream
in java?
推荐答案
如果问题是:这些类之间有什么区别,这里是摘要,但请阅读javadoc以获取更多信息info:
If the question is : "what the difference between those classes", here is a summary, but read the javadoc for more info :
inputStream是从流(网络或文件)中读取字节的基类。它提供了从流中读取字节并检测流结束的能力。
An inputStream is the base class to read bytes from a stream (network or file). It provides the ability to read bytes from the stream and detect the end of the stream.
DataInputStream是一种直接读取数据作为原始数据类型的InputStream。
DataInputStream is a kind of InputStream to read data directly as primitive data types.
BufferedInputStream是一种inputStream,它从流中读取数据并使用缓冲区来优化对数据的快速访问。数据基本上是提前读取的,这减少了磁盘或网络访问。
BufferedInputStream is a kind of inputStream that reads data from a stream and uses a buffer to optimize speed access to data. data is basicaly read ahead of time and this reduces disk or network access.
这篇关于java中的`InputStream``DataInputStream`和`BufferedInputStream`的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!