This class is used to read information from stream. To make the performance fast, it internally uses buffer mechanism. Internal buffer array gets created when a BufferedInputStream is created.
public class BufferedInputStream extends FilterInputStream
Create a text file named text1 in D drive with following data(Any data can be written):
I love Coding!!
Save and test the program for the execution.
An array is internally created during the creation of BufferedInputStream
While reading the bytes, array internally is filled automatically if the bytes are skipped
Following is the syntax for java.io.BufferedInputStream class is
public class BufferedInputStream extends FilterInputStream
Constructor | Short Description of the constructor |
BufferedInputStream(InputStream IS) |
Creation of BufferedInputStream |
BufferedInputStream(InputStream IS, int size) |
Creation of BufferedInputStream with definite size |
Name of Method | Short Description of the method |
int read( ) |
To read the data from the input stream |
int available() |
Returns the estimation of available bytes |
int read(byte[] b, int off, int In) |
Read the specified byte type into a specified byte array |
void close() |
Performs close and release the resource utilized by it |
void reset() |
It place back the stream in the previously called position |
Knowledge2life
|