Abbreviated byte stream and character stream

First, what is a stream? What is the input and output streams?

  Stream is an abstract concept, the abstraction of the input and output device, the input stream can be considered an input channel, to the external program requires the incoming data stream input means; output streams can be output as a channel, the data transmitted to the external program requires With the output stream.

 

Second, what is the byte stream and character stream?

  1, byte stream: the basic unit of data transfer is a byte stream. Class byte stream stream typically ends

    Input stream of bytes: commonly used are:

      a, InputStream: abstract base class is the input byte stream, can not create an object, but can be used to "Programming Interface."

      b, FileInputStream: a file input stream for operating the main, is used to read file data stream, it needs to be used to instantiate a file object. It may be used in addition to the definition of the base class, the base class also implements the read () function (no arguments)

      c, BufferedInputStream (FileInputStream subclass, are not directly implemented by the InputStream subclass): This is a package to enhance the efficiency of other flow stream, it needs to initialize a stream object of the InputStream. Encapsulating the data in advance into memory, manipulating data in memory to be fast, so its efficiency is much higher for the non-buffered. It may be used in addition to the definition of the base class, the base class also implements the read () function (no arguments)

    Output stream of bytes: commonly used are:

      a、OutputStream

      b、FileOutput

 

 

Guess you like

Origin www.cnblogs.com/yangrongkuan/p/11999974.html