This week's main learning content is as follows:
A. Java Io Stream Object
IO stream is mainly used in hard-core, memory, keyboard and other processing equipment data operation, according to the data type of processing data can be divided into: byte stream (abstract base class is InputStream and OutputStream) and character stream (abstract base class for reader and writer)
1. Input byte stream InputStream
InputStream is the parent class for all input byte streams, which is an abstract class.
Bytearrayinputstream, StringBufferInputStream, FileInputStream are three basic media streams that read data from byte arrays, StringBuffer, and local files, respectively. PipedInputStream is to read data from a pipeline that is shared with other threads.
ObjectInputStream and all FilterInputStream subclasses are decorative streams (the protagonist of the adorner pattern).
2. Output byte stream outputstream
OutputStream is the parent class for all output byte streams, which is an abstract class.
Bytearrayoutputstream, FileOutputStream, are two basic media streams that write data to byte arrays, and local files, respectively. PipedOutputStream is writing data to a pipeline that is shared with other threads.
ObjectOutputStream and all filteroutputstream subclasses are decorative streams.
Two. Java Network programming
1. Fundamentals of Java Network programming
IP and port: IP is used to mark a computer, and a port is used to mark a particular application on a computer.
Client and server: The client is the computer that serves the service, and the server is the computer that provides the service. Client and server, can be referred to as C/S model.
TCP and UDP:TCP, Transmission Control Protocol, is a connection-oriented reliable transport protocol, UDP, User Packet protocol, is a non-connected unreliable transmission protocol.
2. Using Java for TCP and UDP communication
Java network programming classes and interfaces are placed in the java.io package.
Classes for TCP communication: Java.io.ServerSocket and Java.io.Socket classes, while UDP traffic classes Java.io.DatagramPacket and
Java.io.DatagramSocket class.
Three. Java parsing XML, parsing XML four methods, DOM, SAX, JDOM, dom4j, XPath
The main use: Sax, Dom is two methods of parsing XML documents (no concrete implementation, just interface), so only they are unable to parse the XML document;
Java bit Five