Statement: The material used in this column is written by the VIP students of the Kay Academy, who has the right to be anonymous and has the final right to interpret the article; The Edith Academy is designed to promote students to learn from each other on the basis of public notes.
Io:
Java.io.OutputStream
Method:
FileOutputStream output data to disk
As an example: output data, the output is a byte
For example, output data is output multiple bytes
If it is a file copy, an input channel, an output channel, copied from the source file to the specified file up
But the copy will be very slow, there are two kinds of machine, one is solid-state drive, one is a mechanical hard disk, your SSD speed is faster, but every time you request is a byte, it will go to the hard drive to take one, read a slow, read more than a bit faster, no matter how big, in 8k way to read the line
Decorative design mode: Is the original data based on processing (processing) to form a new product, the current file stream is to go by byte byte, like a river, with the pipe to pull these water out, this is a primitive transport, transport up through a pond to purify, after the evolution of a processing area, Then in the packaging of a bottled water, that is, in the original data processing to form a new product, and then decorate and form a new product, decoration is a process
In the example: processing in the original byte to form a picture, this kind of processing is a kind of decoding
Beverage Example: Add new ingredients to the original base to form a new product
As the following picture, are seasoning, you can mix
And then you write a test class that you can match freely
Bufferedoutputstream continue caching in memory
ObjectOutputStream
Error:
javase--Decorative design mode