First, the stream is divided into input and output streams, and Java is divided into byte stream and character stream
1. Byte input stream io. InputStream
Io. InputStream is an abstract class that implements an abstract class of closeable interfaces. Then its subclass (IO package) has Bytearrayinputstream,fileinputstream,filterinputstream,pipedinputstream
Bytearrayinputstream is a byte array as a buffer.
FileInputStream is primarily used for files, see the file class to discover that a file object is more than just a document or a path.
The role of FilterInputStream is to "encapsulate other input streams and provide them with additional functionality". Its commonly used subclasses are Bufferedinputstream and DataInputStream. So here's the bufferedinputstream.
function is to provide buffering for the input stream, as well as the mark () and reset () functions.
The PipedInputStream is primarily used for switching multiple pipelines in multiple threads.
2 . Byte output stream io. OutputStream Ibid .
3. Character input stream io. Reader
4. Character output stream io. Writer
The answer is yes if the character and byte stream can be converted to each other.
Inputstreamreader&outputstreamwriter
Java IO Fundamentals (java.io)