character encoding;
6. Pipeline Input class: PipedInputStream classThe pipeline stream reads data from a management output flow. Typically one thread writes data to the management output stream, and another thread reads data from the management input stream, and two threads can communicate with the pipeline.7. Reader and writer OverviewThe InputStream and O
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
readAllLines (Path path, Charset cs) method. This method is similar to the previous method, and you do not need to close the file after reading the file. However, it returns a string array instead of a byte array. Furthermore, Java 8 overrides this method and directly uses UTF-8 encoding for String Conversion without specifying character sets.If you want to read
Stream is a newly added class of Java 8 that complements the collection class.The stream represents the data stream, and the number of data elements in the stream can be limited or infinite.The difference between
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
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(
): Constructs a FileWriter object based on the given file name.FileWriter (String filename, boolean append): Constructs a FileWriter object based on the given file name and a Boolean value that indicates whether to append the data.Member method: The member method of the parent class () does not have its own member method6/2 FileReader (character stream, basic stream)---> InputStreamReader sub-classConstruct
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
another folder. Only the. java file is copied.
* Analysis: 1. When we get this question, we still need to solve the big problem and small problem.
* (1) keyboard input> to determine whether a folder path is correct> WE can encapsulate the input string into a File and use exists () to determine whether a return value of the boolean type exists.
* (2) Get the correct folder address. we started to choose what stream
This cainiao is involved in Java. I am not in a rush to look at the basic syntax, the features of some Java versions, or some promotion knowledge, because there is one thing. net (OOP) programming ideas, so you can find and learn these Java syntaxes and what they are used. I can't wait to use JAVA to add, delete, modif
java-input/output stream1 , input and output:Input/output (Input/output) refers to the input or output of data to a device or environment. Any language has the function of input and output, in the Java program, through the stream to complete the input and output, it through the Java input and output system to connect t
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 to different flow: input flow and output flow
The origin of character streams: Because file
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
IO stream 03 -- video Study Notes for bixiangdong JAVA basic tutorial, 03 -- bixiangdong
Abstract
16 read the conversion stream17 write a conversion stream18 stream operation rules-119 stream operation rules-220. Change the standard input/output device21 abnormal log information22. System Information
16 read the conve
data * 2, call the Write () method * 3, close the Stream object, call the Close () method, release the funding SOURCE */public static void main (string[] args) throws IOException {//File F = new File ("D:\\eclipse\\demo.txt");//FileOutput Stream fos = new FileOutputStream (f, true);//fos.write;//Fos.write (+);//Fos.write (48);//If you pass in a negative number, then go kanji// A Chinese character accounts
As a bridge between Java and database, JDBC is one of the foundation of Javaweb background, which needs us to be familiar with its principle and usage.
JDBC General steps for using are:
1, the use of reflection loading driver, such as Class.forName ("Com.mysql.jdbc.Driver");
2, access to the database connection objects, such as Java.sql.Connection conn = Driverma
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.
stream.Therefore, you can only call the Close method of the outer flow to close the inner laminar flow of its adornment, to verify the example:public static void Main (string[] args) throws Exception { FileOutputStream fos = new FileOutputStream ("D:\\a.txt");
outputstreamwriter OSW = new OutputStreamWriter (FOS, "UTF-8"); BufferedWriter bw = new BufferedWriter (OSW); Bw.write ("Java
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.