Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public void main() {
// FileInputStream - responsible for reading the file
FileInputStream fileInputStream = new FileInputStream("file.txt");
// BufferedInputStream extends FilterInputStream and not FileInputStream, it is
// a decorator which enhances the functionality of the original object by wrapping over it.
BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
// The read operation becomes buffered now;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment