specific object embodies:
InputStreamReader: byte-to-character Bridge
OutputStreamWriter: character-to-byte bridge
These two stream objects are members of the character system, they have transformations, and themselves are character streams, so it is necessary to pass in a byte stream object when constructing.8.File classThe file class is an ob
[JavaSE] IO stream (recursive FIle list of FIle objects), javaseio
Get the File object, new, and construct the parameter: String directory name
Call the list () method of the File object to obtain the name of the String [] array File.
Loop array, listing all files including hidden files
Recursively list all data
Defin
Java IO Stream Learning Summary one: input and output stream
Reprint please indicate source: http://blog.csdn.net/zhaoyanjun6/article/details/54292148This article is from "Zhaoyan's blog"
Java Flow class diagram structure:Concept and function of flowA stream is
MkDir () and Mkdirs (): When the upper directory of the file directory to be created does not exist. This method puts back false, indicating that the creation was unsuccessful. Mkdirs () Creates a non-existent top-level file directoryList (): Enumerates the paths of all sub-files under the current file directory, string[]Listfiles () lists all the sub-files under the current file directory. File[]Other methods:Exists (): Determines whether the current file or file directory exists on the hard d
String s = "mu lesson abc"; byte[] bytes1 = S.getbytes ();//convert to byte sequence using the project default encoding, encoding Gbkfor (byte b:bytes1) {//bytes (converted to) int is displayed in 16 binary mode, only Show post 8-bit System.out.println (integer.tohexstring (b 0xff) + ""); GBK encoding Chinese occupies two bytes, English occupies 1 bytes//utf-8 encoding Chinese occupies 3 bytes, English occ
program to provide powerful, flexible read and write functions. 1.2, Java.io Common classAll stream classes provided by the JDK are located in the Java.io package, each inheriting from the following four abstract stream classes:InputStream: Streams that inherit from InputStream are used to enter data into the program, and the Data units are bytes (8-bit).Outputs
and encapsulation of streams, it provides powerful and flexible reading and writing function for the program by processing the data. 1.2, Java.io Common classAll stream classes provided by the JDK are located in the Java.io package, each inheriting from the following four abstract stream classes:InputStream: Streams that inherit from InputStream are used toinput Data, and the dataunits are bytes(
transmit data.
The four classes are abstract classes and cannot be instantiated. They must be implemented through the methods provided by the four abstract classes.
V. InputStream architecture 5.1. base class of byte input stream
FileInputStream: reads data from a file.
StringBufferInputStream: Rotate strings into input streams. This class has been discarded and replaced by StringBufferReader.
PipedInputStream: connects to a PipedOutputStream, which
file. The ObjectOutputStream class writes serialized objects to a specified place after serialization. The output stream of the PipedOutputStream pipeline is the sending end of the pipeline.
3. Objectstream and InputStream are often used together with FileInputStream and FileOutputStream. (Used during initialization)
ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream("Logon.out"));
4. The File class is not a File, but
Java input/output stream (1)
1. What is IO?
In Java, I/O operations mainly refer to the use of Java for input and output operations. all Java I/O mechanisms are input and output based on data streams, which represent the flow sequence of character or byte data.
beginning, pointer = 0; 3 Raf.write (byte); // The Write method writes only one byte while the direct pointer points to the next position int b = raf.read (); // each time a byte is read, each character in Java occupies two bytes, and a 8-bit right shift is used to write 5 raf.seek (pointer position) in a split-second way; // Move the pointer 6 raf.close (); // file read and write must be closed, otherwise
/fileoutputstream (node stream) (Note: fileinputstream (path name, Boolean) Boolean is true, indicating splicing)Datainputstream/dataoutputstream data input stream allows applications to "machine-independent"Read the Basic Java data types from the underlying input stream (8
function Description
FileOutputStream
Output stream written to file
PipedOutputStream
Output piping
Filteroutputstream
Filtering the output stream
Bytearrayoutputstream
Writes the output stream of a byte array
ObjectOutputStream
The output
InputStream and OutputStream, both abstract class, the input and output operations of a byte stream are implemented by subclasses of these two classes. The character stream is the newly added stream of input and output processing in character units after Java version 1.1, and the character
classification of Java IO streamsstreams in Java can be categorized from different angles. Sort by flow: input stream: The stream from which the program can read data.Output stream: The stream to which the program can write data.
write encoding formats 2. Common encoding Format ASCII American Standard Information Code iso8859-1 European code ANSI code is divided into a variety of Simplified Chinese GB2312 GBK Traditional Chinese big-5 Unicode encoding International standard codes compatible with most countries the encoding format can be divided into UTF-6 UTF-8 UTF-16character buffered input stream and character buffered output
8 Steps to learn Java, easy monthly entry of over, 8 Steps java monthly entry
Java, as a general programming language, can do a lot of things, but it depends on how to learn Java. Many beginners want to remember the basic principl
Java input/output stream (2)
6. Java. IO stream class library1. Four Basic classes of io streams
The java. io package contains all classes required for stream I/O. There are four basic classes in the
1. Io Stream (Overview of IO Stream and its classification)
1. Concept
IO streams are used to process data transfer between devices
The Java operation of the data is streamed through the way
The classes that Java uses to manipulate the flow are in the IO package
Flows are divided 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.