IO stream in Java, input and output stream, character byte stream

A stream is an abstraction that is responsible for the input and output of data. That is, the transfer of data between two devices is called a stream. The essence of a stream is data transfer. The classes that flow in Java are placed in the java.io package.

Streams can be divided into two types, byte stream and character stream, and the objects to be transferred are bytes and characters, respectively.

The flow directions according to different data can also be divided into an input stream and an output stream.

Both Inputstream (byte input stream) and Reader (character input stream) are read, which is equivalent to reading data from an external file into the program.

Both the Outputstream (byte output stream) and the Writer (character output stream) are written, which is equivalent to writing the data in the program to an external file.

Inputstream is the parent class of all byte input streams and is an abstract class for byte input streams.

Inputstream constructor and implementation method, as shown in Figure api

The Reader class is an abstract class for character input streams, which is the parent class for all character input streams.

The Outputstream is the parent of all byte output streams and is an abstract class for byte output streams.

The Writer class is an abstract class for character output streams, which is the parent class for all character output streams.

Intelligent Recommendation

Java IO stream (byte stream and character stream)

File class The File class is a class that operates on files. 1.1 directory separator In windows and non-windows systems, the directory separator is different: windows: Adopt\ Non-windows: Adopt/ 1.2 C...

(Java) IO stream (byte stream + character stream)

Article Directory Byte stream Everything is a byte Byte output stream [OutputStream] FileOutputStream class Construction method Write out byte data Code demo Data append and write Write newline Code d...

Java byte stream character stream io stream

Java character stream byte stream 1. First, let's first understand a concept what is io stream Stream is an abstract concept. It represents the unstructured transfer of data. Input and output are carr...

IO stream in Java: byte stream and character stream

Article Directory IO stream overview Byte stream FileInputStream and FileOutputStream stream FileInputStream stream BufferdInputStream and BufferdOutputStream streams BufferdInputStream stream Bufferd...

Java-IO stream-byte stream and character stream

Byte stream First picture: InputStream Then use FileInputStream to instantiate the object Take a look at this byte input system OutputStream (like InputStream, INPUT is replaced with OUTPUT) Implement...

More Recommendation

Java IO stream: byte stream, character stream

First, the classification of flow 1. Move data unit: byte stream, character stream 2. Data flow: input flow, output flow 3. Flow role: node flow, processing flow Second, the architecture of the stream...

Stream (byte stream, character stream, input and output stream, filter stream)

flow: A way of inputting and outputting java, just like water flow, data flows in and out of the water stream. The format of the data is also diverse. Binary data is formatted and processed by normali...

The byte input and byte output stream in the IO stream

Byte input stream FileInputStream Common method Read () return value is int type: read a byte content (after reading, return -1) Read (byte [] buffer) reads a number of byte groups. The return is not ...

Java-- byte (input / output) stream, a character (input / output) stream

First, the output byte stream OutputStream abstract class This abstract class is a superclass of all classes of the output byte stream. Data operations are byte defines the basic functionality common ...

File class and IO stream (file byte input and output stream, file character input and output stream, byte array input and output stream)

1. Classification according to the direction of the flow (centered on the program): 1. Input stream: data flows from the data source to the program (a stream ending with InputStream, Reader) 2. Output...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top