Dark Horse programmer-other classes in the IO package and other classes in the io package
Other classes in the IO package:
1. Print stream: provides a printing method to print data of various data types as isByte print stream Prin
first, and then use them. I can't find it. In the disk file, deserialize our object data and revert to the Java object.
The class of the object that needs to be serialized must implement the serialization interface: Java.io.Serializable interface (Flag interface [no abstract method])
The bottom will make a judgment, if the current object is an instance of Serializable, to allow serialization: boolean ret = java object instanceof Serializable;
Most class
drives or NAND flash. Read and write memory faster than read or write the hard disk or NAND flash files on the speed of a lot!Currently, files are mostly stored in bytes. So in the development, the use of Word throttling is more extensive.2 Comparison of IO classes for Java 1.0 and Java 1.1Table 01_java 1.0 and Java 1.1 IO base class comparison tableTable 02_jav
J2SE quick advanced -- four basic abstract classes of IO stream: InputStream, OutputStream, Reader, Writer, and abstract class
The above section briefly describes the four abstract classes in the java. io package and Their Relationships. Here we will further summarize them and their subclasses.
At the end of the previ
The four abstract classes and their relationships in the Java.io package are briefly understood above, and further summarize them and their subclasses.At the end of the previous blog, posted the entire IO family in Java, and then the small and re-modified a bit, on the basis of the previous, identified the node stream and processing stream (green for the node stream, yellow for the processing stream).Here,
A review of the Java stream class; habitual review according to the structure of the graph layer down to learn to review, and finally through the code to realize the impression will be more profound;About I/O Flow: IO can be understood as the pipeline that Java uses to pass data, and creating an IO is equivalent to connecting a pipeline with a data source.BYTE stream: the smallest data unit in the data stre
********************InputStreamReader (bytes to characters) and Outputstreamreader(characters to bytes):1.InputStreamReaderA bridge from a byte stream to a character stream: It reads in bytes and converts it to a character stream based on the specified encoding.The encoding used may be specified by name, or the platform can accept the default encoding methodEach invocation of one of the InputStreamReader's read () methods may cause one or more bytes to be read from the base byte input stream.In
connection to the file and ensures that the Close method of this stream is called when the file output stream is no longer referenced.
FileChannel
Getchannel () returns the unique FileChannel object associated with this file output stream.
FileDescriptor
GETFD () returns the file descriptor associated with this stream.
void
Write (byte[] b) writes B.length bytes from a specified byte array to this file output stream.
void
IO Common IO operation class inheritance structure
Io
Character streams
Reader (source)
BufferedReader
LineNumberReader
InputStreamReader
FileReader (a bridge that bytes flow to character streams)
StringReader
Writer (Purpose)
Buff
Java's IO class operations mainly include the following categories
1, the use of the file class.
2, byte operation flow: OutputStream, InputStream
3, character operation Flow: Reader, Writer
4. Serialization of objects: Serializable
(1) File class Java code
public class File extends Object implements Serizliable comparable
From the definition, the file class is a direct subclass of object, and it inherits the comparable interface to sort the array.
T
Compare the classes related to input and output, and hope to help you
Original article http://www.java2000.net/viewthread.jsp? Tid = 1225
Input
Output
Data Type
Description
Inputstream
Outputstream
Byte
Bottom Layer
Bytearrayinputstream
Bytearrayoutputstream
Byte
With byte Buffer
Buffer
Fileinputstream
Fileoutputstream
Byte
Directly operate on files
Issues in the previous section:Co-process: switch on IO operation.But when do you cut it back? How do I know I'm done with IO?first, the event-driven model introductionTypically, when we write a program that server processes a model, there are several models:
(1) Each time a request is received, a new process is created to process the request;(2) Each time a request is received, a new thread is cre
processing.Network applications often have these characteristics, which makes them well suited to the event-driven programming model.The above event-driven model, as long as an IO to register an event, and then the main program can continue to do other things, only to the completion of IO processing, continue to restore the previously interrupted tasks, how is this essentially implemented?Logic diagram:Blo
for several different types of messages, and if one of the types of messages is ready, then select returns the information and then the user-state process calls Recvfrom to receive the data.
The select reuse mechanism can be thought of as a collection of descriptors that can be managed by placing different descriptors in the collection, waiting for different messages to be generated, and then managing them uniformly by select, allowing them to wait for the generation of any event in the c
wrapper classes in JAVAThere is no string inthe wrapper class, it is a reference data typeA base type cannot call a method, and its wrapper class has many methodsThe wrapper class provides two main types of methods:1. ways to convert this type and other basic types2. ways to convert strings and this type and wrapper class to each other
Basic type
The corresponding packaging class
Byte
Byte
Short
To design the "Network hard disk" function, you must first familiarize yourself with the operations for processing files and folders in. net. File and directory are the two most important classes. Understanding them will greatly facilitate the implementation of subsequent functions.
System. Io. File and system. Io. fileinfo
In the process of designing and i
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.