Basic data type input / output stream of Java IO stream

Time:2021-5-1

Basic data type input / output stream

summary:

Basic data types can be read and written

Data input stream: datainputstream

Datainputstream (InputStream in) passes in the InputStream type as a parameter

Data output stream: dataoutputstream

Dataoutputstream (OutputStream out) passes in the OutputStream type as a parameter

characteristic:

1. The stream is a byte stream, which can not only read and write bytes and characters, but also read and write basic data types

2. The output stream of data type is written to the file, which can’t be read when using the text file to open, which improves the security of basic data saved in the file

3. The order of reading must be consistent with that of writing, which improves the security of basic data types in files

FileOutputStream fos=new FileOutputStream("E:\File\3.txt");

File drawing effect:

Basic data type input / output stream of Java IO stream

Write with what type, read with what type.

This work adoptsCC agreementReprint must indicate the author and the link of this article

Recommended Today

Large scale distributed storage system: Principle Analysis and architecture practice.pdf

Focus on “Java back end technology stack” Reply to “interview” for full interview information Distributed storage system, which stores data in multiple independent devices. Traditional network storage system uses centralized storage server to store all data. Storage server becomes the bottleneck of system performance and the focus of reliability and security, which can not meet […]