流定义 [英] Stream definition

查看:73
本文介绍了流定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读Java I / O流,我对与它们相关的正确定义感到困惑。

I'm reading on Java I/O streams and I'm confused on the correct definition associated with them.


  • 有人说流是一种传输数据的传送带......

  • 其他说流是流量或
    a数据序列......

  • 其他说流是与输入或输出
    源的
    连接...

那么正确的定义是什么?

So what's the correct definition?

推荐答案

流是一个概念,但它不是那么严格,只有一个描述是正确的。

A stream is a concept, but it's not that strict, that just only one description would be correct.


I / O流表示输入源或输出目的地。流可以表示许多不同类型的源和目标,包括磁盘文件,设备,其他程序和内存阵列。
Streams 支持许多不同类型的数据,包括简单字节,原始数据类型,本地化字符和对象。有些流只是传递数据;其他人以有用的方式操纵和转换数据。

An I/O Stream represents an input source or an output destination. A stream can represent many different kinds of sources and destinations, including disk files, devices, other programs, and memory arrays. Streams support many different kinds of data, including simple bytes, primitive data types, localized characters, and objects. Some streams simply pass on data; others manipulate and transform the data in useful ways.

无论内部如何工作,所有流都向使用的程序提供相同的简单模型它们:流是一系列数据。

No matter how they work internally, all streams present the same simple model to programs that use them: A stream is a sequence of data.

来自: http://download.oracle.com/javase/tutorial/essential/io/streams.html

流也可以是输入流或输出流。如果它是输入流,在Java中它将遵循 InputStream 界面,后者为 Outputstream

Also a stream is either an input stream or output stream. If it is an input stream, in Java it will adhere to the InputStream interface, the latter to the Outputstream.

(附注:在加密中,例如流和块密码之间存在差异,其中密码是不知道(在一般意义上)任何关于未来的东西,而分组密码知道它(最大值) )提前大小和所有即将到来的块的大小。)

(Side note: In crypto, there's e.g. a difference between stream and block ciphers, where a stream cipher is something that does not know (in a very general sense) anything about the future, while a block cipher knows its (maximum) size in advance and the sizes of all coming blocks.)

这篇关于流定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆