Java learning notes-10. io stream, java learning notes-10.io
1. The input stream can only read data from it, but cannot write data to it. The output stream can only read bytes of data.
2. The InputStream types include:
ByteArrayInputStream contains a memory buffer, which i
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
In recent days carefully learned Java IO stream, originally intended to watch video through the video to learn, but later found that the video does not understand and feel not very easy to use, so through the Baidu and API documents to learn Java IO streamThe IO stream can have two classifications, one is a byte
Classes or interfaces related to Java stream operations:Java Flow class diagram structure:Concept and function of flowA stream is a set of sequences of bytes that have a starting point and an end point, a generic or abstract of the data transfer. That is, the transmission of data between the two devices is called the flow, the essence of the flow is data transmis
Tag: sys specifies code based on row height processing Stringbu image HiveClasses or interfaces related to Java stream operations:Java Flow class diagram structure:concept and function of flowA stream is a set of sequences of bytes that have a starting point and an end point, a generic or abstract of the data transfer. That is, the transmission of data between th
Classes or interfaces related to Java stream operations:Java Flow class diagram structure:concept and function of flowA stream is a set of sequences of bytes that have a starting point and an end point, a generic or abstract of the data transfer. That is, the transmission of data between the two devices is called the flow, the essence of the flow is data transmis
Java console input is completed by system.in.To get a character stream bound to the console, you can wrap the system.in in a BufferedReader object to create a character stream. Need to import this bagimport Java.io.BufferedReader;Here is the basic syntax for creating BufferedReader:New BufferedReader (new InputStreamReader (system.in));Once the BufferedReader obj
created. If the file already exists, the first two constructor methods will delete the existing content of the file. To retain the content of the current file and append new data, use the following two constructor methods and set their parameter append to true.
5.In Java I/O programs, why do I have to declare in the method to throw an exception ioexception or handle the exception in the try-Catch Block?
All methods and constructors except printwrite
Why a character stream existsSince the byte stream provides the ability to handle any type of input/output operation, why is there a character stream? Let me slow down. The byte stream cannot manipulate Unicode characters directly, because a character has two bytes, and the byte st
Streams in Java can be classified from different perspectives.
Different data streams can be divided into input streams and output streams.
Data processing units can be divided into byte streams and batch streams.
Different implementation functions can be divided into node stream and processing stream.
Output stream:
Java-IO streams, Java IO stream characters
Java text (char) is a 16-bit unsigned integer and unicode (dubyte encoding) of characters ).
The file is a data sequence of byte.
A text file is a storage result of serialized text (char) sequences into bytes according to a certain encoding scheme (uft-
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
JDBC (Java Database Connectivity) is a Java API that can execute SQL statements. It can be used to operate different databases.
# JDBC driver: standard SQL statements can be transplanted between different databases, but the actual communication protocol of the database and some database features cannot be transplanted.
IO stream 05 -- video Study Notes for bixiangdong JAVA basic tutorial, 05 -- bixiangdong
Day20
10 create a java file list11 Properties12 Properties access13 Properties14 Properties exercises15 PrintWriter16 merge streams17. Cut files
10 create a java file list
Exercise:Store the absolute path of a
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
Bs.write (buffer); 7// bs.close (); 8// os.close (); 9 }Execution Result:The Close method is not called here, which is equivalent to the contents of the buffer in memory. The bufferedoutputstream itself does not have a close method, and the Close method of the parent class Filteroutputstream is called:1 public void Close () throws IOException {2 try {3 flush (); 4 } catch (IOException ignored) {5 }6 Ou
The input and output functions of the Java language are very powerful and flexible, and the input and output operations of the data are carried out in the form of "stream". J2SDK provides a wide variety of "streaming" classes to get different kinds of data, defined in package java.io. In a program, input or output data through a standard method.Streams in Java ca
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.