Java training, Android training, iOS training,. NET training. Looking forward to your communicationFirst, the conceptFlow: A stream is an abstraction of a sequence of bytes, a data source that can be continuously read, and a stream that can be continuously written to the data.IO stream: Used to process data on the deviceCommon equipment: Hard disk, memory, keyboard input, etc.Classification of IO streams:1,
Classification of Java Streams1. Input/output streamInput stream: Can only read data to it, cannot write.Output stream: Data can only be written to it and cannot be read.The so-called input and output are relative to the application.2. Byte stream/character streamDifferent units, byte stream operation 8 bit, character stream operation 16 bit, twice times the relationship.3. Node stream/Process FlowDivided by the role of the stream.Node stream: A strea
functions. This section provides an example of a new output stream, which filters out space characters in the statements to be output. For example, to output "Java Io outputstream", the filtered output is "javaiooutputstream ". The code for the skipspaceoutputstream class is as follows:
The following is a code snippet:
import java.io.FilterOutputStream;import java.io.IOException;import java.io.OutputStre
"));
String line = Br.readline ();
While [line!= null] {
System.out.println (line);
line = Br.readline ();
}
Br.close ();
}
catch (IOException e) {
System.out.println ("IO Problem");}}
This program contains a try...catch...finally exception handler.
Ad
2017-10-30The interview in the previous days when the exam two questions, are related to the Java Foundation:
Use Java IO package to read and write files;
Use JDBC to get the data.
It is a pity that I could not remember the basic knowledge, so it is necessary to tidy up and consolidate this knowledge.In this summary, I will summarize the read-wr
[Java iO] _ pipeline stream notes
Objectives of this chapter:Understanding the use of thread communication streams (pipeline streams)
Pipeline Flow
The main function of a pipeline stream is to communicate between two threads, namely, pipedoutputstream and pipedinputstream. If you want to output a pipeline, the output must linger on the input stream. The pipedoutputstream class has the following method for c
Last update time: 2014-06-23When learning Java NIO and IO APIs, a problem quickly emerges in our minds:When should I use IO and when should I use NIO?In this article I will try to write out the different places between NiO and Io, their usage scenarios, and how they affect your code design.The main differences between
ioexception{Selector acceptselector = Selectorprovider.provider (). Openselector (); /*Register the selector on the server socket and set the notification to accept the acceptance method. this tells selector that the socket wants to be placed in the ready table when the Accept operation occurson, therefore, agree that multivariate non-clogging I/O occurs. */Selectionkey Acceptkey = Ssc.register (Acceptselector,Selectionkey.op_accept);int keysadded =
as follows, using non-blocking methodsprivate void Waitforconnection () throws ioexception{Selector acceptselector = Selectorprovider.provider (). Openselector (); /* Register the selector on the server socket and set the notification to accept method. This tells selector that the socket wants to be placed in the ready table when the Accept operation occurs */ Selectionkey acceptkey = Ssc.register (Acceptselector, Selectionkey.op_accept);
Overall classification diagram in 1.java flow
Other common flow-related objects:
2.IO Flow
IO flow: Primarily for processing data on devices
Such as: Hard disk, memory, keyboard input
IO has a specific classification: 1. Depending on the type of processing data: byte stream and character streams. 2. According t
First, what is IOIO is essentially a single byte of movement. The flow can be said to be the carrier and way of byte movement, it keeps moving the data to the target. All we have to do is read the data from the stream in the direction of the stream or write the data to the stream.Second, the Java support IO operation of the library class1, according to the data types are divided into two categories:(1) Byte
1. The concept of flowAn abstract concept of input, the operation of files in Java is done in a "flow" manner. The stream can be understood as a "pipe", and the data is transferred from one end to the other through the pipe.Flow has directionality: In general, this direction is based on the program as a reference, so, the input stream refers to the flow of the program, the output stream refers to the flow from the program output, it can also be unders
1. Java.io.File classThe file class represents system files (files and directories), and files and directories on disk are represented in Java programs by an instance of the file class.Common construction Methods: File (String pathname); File (file parent, String child); File (String parent,string Child)Creates a file object with pathname as the path, and if pathname is a relative path, it is relative to the JavaThe path in System Properties User.dir
In the log file of your WebLogic Server, you may see exception
(Window nt)
Java. Io. ioexception Connection reset by peer
Java. Io. ioexception: clientabortexception: java.net. socketexception: Connection reset by peer: Socket
J2SE Knowledge points inductive note (vii)---Java IO Part 4: Basic character stream--Reprint Please specify Source: Coder-pigIntroduction to this section:In the previous section, we learned about some basic byte streams in the Java IO Stream, both of which are inputstream andA subclass of OutputStream; This section lea
Java 1.0 IO System Introduction1 Java IO versionThe IO of the Java library is divided into two parts: input/output.The early Java 1.0 version of the input system was inputstream and its
//filereader fr=new filereader ("D:/test/s1.txt"); BufferedReader br=NewBufferedReader (ISR); OutputStreamWriter OSW=NewOutputStreamWriter (NewFileOutputStream ("D:/test/s2.txt"), "GB2312"); //FileWriter fw=new FileWriter ("D:/test/s2.txt");//S2 does not exist, it is automatically createdBufferedWriter BW =NewBufferedWriter (OSW); //2. Start reading filesString Line;//declaring variables used to hold read-out content intNum=1;//used to record the number of rows while((Line
[Java iO] _ merge stream notes
Merge stream: in terms of concept, the content is merged.
Common Methods of sequenceinputstream classNo. Method description1 Public sequenceinputstream (inputstream S1, inputstream S2) uses two input stream objects to instantiate this class object.2 Public int available () throws ioexception returns the file size
Import
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.