Java bit Five

Source: Internet
Author: User

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

Related Article

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.