What are the differences between BufferedOutputStream and OutputStream.
What i've read is that bos is faster and better for large file than os but i don't really understand why. Hope to get some clarification and insight on these 2 topics.
What are the differences between BufferedOutputStream and OutputStream.
What i've read is that bos is faster and better for large file than os but i don't really understand why. Hope to get some clarification and insight on these 2 topics.
AS IO operations are costlier, BufferedOutputStream first writes them in buffer and write the chunk on underlying OutputStream. BufferedOutputStream uses decorator patterns where it attaches the additional responisibilty at run time to OutputStream.
Same is true for BufferedInputStream which reads the bytes in chunk and place them in buffer. When actual read operation occurs , it reads from that buffer instead of underlying InputStream like disk which is costlier