Java BufferedOutputStream class
Java BufferedOutputStream class uses an internal buffer to store data. It adds more efficiency than to write data directly into a stream. So, it makes the performance fast.
Example of BufferedOutputStream class:
In this example, we are writing the textual information in the BufferedOutputStream object which is connected to the FileOutputStream object. The flush() flushes the data of one stream and send it into another. It is required if you have connected the one stream with another.
Output:
success...
Java BufferedInputStream class
Java BufferedInputStream class is used to read information from stream. It internally uses buffer mechanism to make the performance fast.
Example of Java BufferedInputStream
Let's see the simple example to read data of file using BufferedInputStream.
Output:
Sachin is my favourite player
No comments:
Post a Comment