Should I use DataInputStream or BufferedInputStream

前端 未结 7 934
南方客
南方客 2020-12-13 20:55

I want to read each line from a text file and store them in an ArrayList (each line being one entry in the ArrayList).

So far I understand that a BufferedInputStream

相关标签:
7条回答
  • 2020-12-13 21:47

    InputStream: Base class to read byte from stream (network or file ), provide ability to read byte from the stream and delete the end of the stream.

    DataInputStream: To read data directly as a primitive datatype.

    BufferInputStream: Read data from the input stream and use buffer to optimize the speed to access the data.

    0 讨论(0)
提交回复
热议问题