search
HomeJavaJavaBasewhat is stream in java

what is stream in java

Nov 12, 2019 am 09:21 AM
java

The stream in Java is an abstract concept. When the program needs to read data from a certain data source, it will open a data stream. The data source can be a file, memory or network, etc.

what is stream in java

On the contrary, when you need to write data to a data source destination, a data stream will also be opened. , the data source destination can also be a file, memory or network, etc.

A stream is a set of sequential bytes with a starting point and an ending point. It is a general term or abstract for data transmission. That is, the transmission of data between two devices is called a stream. (Recommended study: java course)

The essence of a stream is data transmission. The stream is abstracted into various classes according to the data transmission characteristics to facilitate more intuitive data operations.

Streams in Java can be classified from different perspectives:

According to the direction of the stream: It is divided into input stream and output stream.

According to the different processing data units: is divided into byte stream (8 bits) and character stream (16 bits).

According to different functions: It is divided into node flow and processing flow.

Node stream: is a stream (such as file, memory) that can read and write data from a specific data source (node). It's like a single pipe is connected to a faucet and starts discharging water.

Processing stream: is "connected" to an existing stream (node ​​stream or processing stream), and provides the program with more powerful reading and writing functions by processing data. It is like connecting a pipe (node ​​flow) and adding several thicker pipes (processing flow) with special functions to further process the outflowing water.

The four basic streams InputStream, OutputStream, Reader, and Writer each have more specific subclasses, which are divided into file stream, buffer stream, data stream, conversion stream, Print stream, Object stream, etc., all of which are respectively Specific functions or used to operate specific data

The above is the detailed content of what is stream in java. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools