+ 3

what is the difference between ByteArrayInputStream class and BufferedInputStream class?

(since both use buffer memory).

15th Jul 2016, 9:48 AM
Dhiman Das
Dhiman Das - avatar
1 Odpowiedź
+ 2
You might be seeing the constructor for ByteArrayInputStream, which is an InputStream that reads through a byte[] so does no actual I/O. If you are reading through your byte[] byte by byte then you will probably find using a BufferedInputStream or ByteArrayInputStream simplifies your code at some performance cost. (Note don't mix using BufferedInputStream with using the underlying stream, because the former buffers.
7th Aug 2016, 7:16 AM
Mohammad Reza Karimi
Mohammad Reza Karimi - avatar