Java standard stream input output stream in (out) Putstream,readerwriter etc summary (1)

Source: Internet
Author: User

One, standard output stream System.out
System.out output data to standard output devices in a number of ways:

The main difference between print () and println () is that the latter output is not a career change, printf () is mainly formatted output
One, standard input stream system.in
System.in reads standard input device data (obtains data from standard input, usually keyboard) int read ()//returns ASCII code. If, the return value =-1, indicates that no read to any byte read work ends.
int read (byte[] b)//Read in multiple bytes to buffer b The return value is the number of bytes read in

 Public classInput { Public Static void Main(String args[]) {intbTry{System. out. println ("Please Input:"); while((b = System.)inch. read ())! =-1) {//system.in.read ()System. out. Print (Char) b); }         }Catch(IOException e) {System. out. println (E.tostring ()); }     } }//console input What, press ENTER key will output what

Thirdly, various input streams and various output streams of the Java.io Stream class library
Inheritance relationship





There are more input streams and output streams in Java, we generally only need to master 17 kinds of

fileinputstream//file byte output stream
fileoutputstream//file byte output stream
FileReader//file character input stream
FileWriter//file character output stream

bufferedreader//Cache character Input stream
bufferedwriter//Cache Character Output stream
bufferedinputstream//Cache byte Input stream
bufferedoutputstream//Cache byte output stream

datainputstream//Data input Stream
dataoutputstream//Data output stream

objectinputstream.//Object Input Stream
objectoutputstream//Object Output stream

printwriter//print output stream, a previous article introduced

Each input stream is explained in the following article

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Java standard stream input output stream in (out) Putstream,readerwriter etc summary (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.