streamThe print stream only has no input stream for the output stream, and the printwriter and printstream are for character bytes respectively.The two classes provide the overloaded print and println methods for output of multiple data types.Output operations of printwriter and printstream will not throw an exceptionPrintwriter and printstream have the automati
Java stream operations can be divided into byte streams and byte streams.
1. byte stream
All read Operations inherit from a common superclass java. io. InputStream class.
All write operations inherit from a common superclass java. io. OutputStream class.
Both
The lambda expression is described earlier, but we can see that the lambda expression actually simplifies the writing of a part of the code and is not a very useful language feature. But if the lambda expression fits into the Stream class library described in this article, it will play a huge role. initial knowledge of flow class library
As usual, let's take a look at an example. There is a list of integers, and I would now like to find all of them gr
. 4. public void Flush (): Outputs all data in the data buffer and empties the buffer. 5. public void Close (): closes the output stream and frees the system resources associated with the stream.The Java Stream class provides a structured approach, such as the underlying stream and the high-level f
), character stream in characters, according to the Code table mapping characters, one can read multiple bytes at a time.
The processing object is different: The byte stream can handle all types of data (slices, AVI, etc.), while the character stream can only handle data of the type of characters.
BYTE stream:
;> 24);//high 8-bit raf.write (i >>>); Raf.write (i >>> 8); Raf.write (i); System.out.println (Raf.getfilepointer ());//You can write a intraf.writeint (i) directly; String s = "medium"; byte[] GBK = s.getbytes ("GBK"); Raf.write (GBK); System.out.println (Raf.length ());//Read the file, you must move the pointer to the head raf.seek (0);//One-time read, read the contents of the file into a byte array byte[
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
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
)* Write objects stored in the collectionPerson p1 = new Person("张三", 23);Person p2 = new Person("李四", 24);Person p3 = new Person("马哥", 18);Person p4 = new Person("辉哥", 20);ArrayList
The read is a collection objectObjectInputStream ois = new ObjectInputStream(new FileInputStream("f.txt")); ArrayList
8. IO stream (plus ID number)
Attention
The object to be written must im
1. servlet filter concept:**************************************** ***************The servlet filter is defined in java servlet specification 2.3. It can check and modify the request and response objects of the servlet container.
The servlet filter does not generate request and response objects. It can only provide fil
an absolute path file does not exist or can be judgedGet method1.String GetName ()2.String GetPath ()3.String GetAbsolutePath ()4.String getParent ()//if No parent directory returns null5.long LastModified ()//gets The last modified time6.long length ()7.boolean Renameto (File F)8.file[] liseroots ()//get Machine Drive letter9.string[] List ()10.string[] List (filenamefilter Filter)
Common method impleme
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
Original address: http://www.cnblogs.com/oubo/archive/2012/01/06/2394638.htmlClasses 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
Classes or interfaces related to Java stream operations:Java Flow class diagram structure:Remark: Bytearrayreader fixed to CharArrayReaderconcept 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 th
is not conducive to use, the servlet should have been created to simplify the work Ah! I thought it was my design framework that created a problem. The next day I asked the teacher, there are indeed some problems in use. For example, to display the access count, I wrote it separately as a servlet, and where it was needed, the servlet.include reference to the counted servlet. But this will always produce some problems and inconvenience in use. For example, the include servlet must use the same
Classes or interfaces related to Java stream operations:
Java stream class diagram structure:
Concept and function of stream
A stream is a set of sequential bytes with a starting point and an ending point. It is a general term
following is a character stream, so two can not be passed by legendInputstreamreader/outputstreamwriter Bridge Conversion converts bytes into character streams in the process of bridge conversion, you can make a codecBufferedreader/printwriter with BufferWhen a character stream is converted to a byte stream, the specified codec is specified when the bridge is co
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
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.