Using a BufferedInputStream is useful because it cuts down on read system calls. But the same effect can be produced, say in reading a file, if we use FileInputStream's read method that takes a byte array as input. A lot of bytes are read in a single call. Am I right ? Then, why is it that we need to wrap it inside a BufferedInputStream object ?
daudiam
-8
Junior Poster
Recommended Answers
Jump to PostWhether you want to do the work yourself, or you want to control the read size of the buffer, or you don't want line endings getting hacked off (if using readLine), etc, etc.
Jump to PostOkay, readLine is BufferedReader. In any case, those things I mentioned are using InputStream, BufferedInputStream handles those things for you.
All 8 Replies
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
daudiam
-8
Junior Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
daudiam
-8
Junior Poster
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
daudiam
-8
Junior Poster
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
daudiam
-8
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.