@1: Byte stream:
Java.io.InputStream:
Public abstract class InputStream
This abstract class was the superclass of all classes representing an input stream of bytes.
Java.io.OutputStream:
Public abstract class OutputStream
This abstract class was the superclass of all classes representing an output stream of bytes.
InputStream is the ancestor of all byte input streams, and OutputStream is the ancestor of all byte output streams.
@2: Character Stream:
Java.io.Reader:
Public abstract class Reader
Abstract class for reading character streams.
Java.io.Writer:
Public abstract class Writer
Abstract class for writing to character streams.
Reader is the ancestor of all read string input streams, while writer is the ancestor of all output strings.
Inputstream,outputstream,reader,writer are abstract classes. So you can't go straight to new.
@3: Comparison:
The character stream uses buffers, and the byte streams do not use buffers. For validation and code samples that use buffers, you can see here.
Q: Is it good to use a byte stream or a good character flow?
A: Using A byte stream is better.
All files are carried out in bytes on the hard drive or in the transmission, including pictures, etc., which are stored in bytes, and characters are only formed in memory , so
In the development, the use of byte stream is more extensive.
Many other streams have also appeared in the java.io, mainly to improve performance and ease of use.
Byte stream and character stream in Java