Objective:
We are using Java io stream outputstream, printwriter ... , the Flush () method is often used.
A Why to Flush:
Like caching in network hardware, streams can also be cached in software, which is cached directly in Java code. This can be
Implemented through Bufferedoutputstream or bufferedwriter links to the underlying stream. Therefore, in writingWhen the data is finished, flush becomes particularly important.For example:The Web server responds with a 300-byte message through the
Document directory
Main methods and constants in the file class
Procedure
Byte output stream: outputstream
Byte input stream: inputstream
Character output stream: writer
Character input stream: Reader
File class
In the entire Io package,
Everyone in the Java IO stream using OutputStream, PrintWriter ... , the Flush () method is often used.Like caching in network hardware, streams can also be cached in software, directly in Java code. This can be achieved by Bufferedoutputstream or
Java IO producer stream and byte streamI. Basic Concepts
Stream: flows from one end to the other, from the source to the destination.Always centered on the program, it is a program and a file | array | Network Connection | database operations.
Ii.
The content of this article:
What is a stream
BYTE stream
Character Stream
Starting Date: 2018-07-24
what is a stream
Flow is an abstract concept, is an abstraction of input, the input stream can be regarded as
Java IO stream byte stream, java IO stream byteI. Common file Operations
File file = new File ("E: \ test \ javaIo"); System. out. println (file. isDirectory (); // determines whether the file is a directory (if the file does not exist, false is
In Java development, sometimes we do the flow of operations, so you may often encounter such a piece of codeOut.flush (); Out.close ();Sometimes we just understand this, but do not know the principle of the things, the following to understand:Flush (
String
1. char_traits character feature class1) significance: Wrap the universal behavior interface of a specific string element so that the container can execute a specific behavior based on the feature information.2) A general type name is defined.
Java processing files in the class, stream at the end of the use of byte stream, reader and writer End is a character stream. The difference between the two is read and write, one is read by Byte, and the other is by character.
The bottom of the
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.