All About Class BufferedOutputStream in Java



BufferedOutputStream class implements a buffered output stream. By setting up such an output stream,an application can write bytes to the underlying output stream without necessarily causing to call to the underlying system for each byte written. The data is written into a buffer,and then written to the underlying system.If the buffer reaches it's capacity,the buffer output stream is closed or the buffer stream is explicitly flushed.

The structure of the class BufferedOutputStream is given as:

public class java.io.BufferedOutputStream extends java.io.FilterOutputStream{
//member elements
protected byte buf[];//A buffer array of bytes where data is stored
protected int count;//the number of valid bytes in the buffer
//Constructors
public BufferedOutputStrea(OutputStream out);//creates a new buffered output stream to write data 
//to the specified underlying output stream with default 512 byte buffer size.
public BufferedOutputStrea(OutputStream out,int size);//creates a new buffered output stream to write data 
//to the specified underlying output stream with the specified buffer size.
//Methods:
public void flush();
public void write(byte b[],int offSet,int length);
public void write(int b);
}
 
All About Class BufferedOutputStream in Java All About Class BufferedOutputStream in Java Reviewed by Animesh Chatterjee on October 08, 2018 Rating: 5

No comments:

Powered by Blogger.