- Java.io - Writer
- Java.io - StringWriter
- Java.io - StringReader
- Java.io - StringBufferInputStream
- Java.io - StreamTokenizer
- Java.io - SerializablePermission
- Java.io - SequenceInputStream
- Java.io - Reader
- Java.io - RandomAccessFile
- Java.io - PushbackReader
- Java.io - PushbackInputStream
- Java.io - PrintWriter
- Java.io - PrintStream
- Java.io - PipedWriter
- Java.io - PipedReader
- Java.io - PipedOutputStream
- Java.io - PipedInputStream
- Java.io - OutputStreamWriter
- Java.io - OutputStream
- Java.io - ObjectStreamField
- Java.io - ObjectStreamClass
- io - ObjectOutputStream.PutField
- Java.io - ObjectOutputStream
- Java.io - ObjectInputStream.GetField
- Java.io - ObjectInputStream
- Java.io - LineNumberReader
- Java.io - LineNumberInputStream
- Java.io - InputStreamReader
- Java.io - InputStream
- Java.io - FilterWriter
- Java.io - FilterReader
- Java.io - FilterOutputStream
- Java.io - FilterInputStream
- Java.io - FileWriter
- Java.io - FileReader
- Java.io - FilePermission
- Java.io - FileOutputStream
- Java.io - FileInputStream
- Java.io - FileDescriptor
- Java.io - File
- Java.io - DataOutputStream
- Java.io - DataInputStream
- Java.io - Console
- Java.io - CharArrayWriter
- Java.io - CharArrayReader
- Java.io - ByteArrayOutputStream
- Java.io - ByteArrayInputStream
- Java.io - BufferedWriter
- Java.io - BufferedReader
- Java.io - BufferedOutputStream
- Java.io - BufferedInputStream
- Java.io - Home
Java.io package extras
Java.io package Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.io.BufferedInputStream Class
Introduction
The Java.io.BufferedInputStream class adds functionapty to another input stream, the abipty to buffer the input and to support the mark and reset methods. Following are the important points about BufferedInputStream −
When the BufferedInputStream is created, an internal buffer array is created.
As bytes from the stream are read or skipped, the internal buffer is refilled as necessary from the contained input stream, many bytes at a time.
Class declaration
Following is the declaration for Java.io.BufferedInputStream class −
pubpc class BufferedInputStream extends FilterInputStream
Field
Following are the fields for Java.io.BufferedInputStream class −
protected byte[] buf − This is the internal buffer array where the data is stored.
protected int count − This is the index one greater than the index of the last vapd byte in the buffer.
protected int markpmit − This is the maximum read ahead allowed after a call to the mark method before subsequent calls to the reset method fail.
protected int markpos − This is the value of the pos field at the time the last mark method was called.
protected int pos − This is the current position in the buffer.
protected InputStream in − This is the input stream to be filtered.
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | BufferedInputStream(InputStream in) This creates a BufferedInputStream and saves its argument, the input stream in, for later use. |
2 | BufferedInputStream(InputStream in, int size) This creates a BufferedInputStream with the specified buffer size, and saves its argument, the input stream in, for later use. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. |
2 | This method closes this input stream and releases any system resources associated with the stream. |
3 | This method see the general contract of the mark method of InputStream. |
4 | This method tests if this input stream supports the mark and reset methods. |
5 | This method reads the next byte of data from the input stream. |
6 | This method reads bytes from this byte-input stream into the specified byte array, starting at the given offset. |
7 | This method repositions this stream to the position at the time the mark method was last called on this input stream. |
8 | This method skips over and discards n bytes of data from this input stream. |
Methods inherited
This class inherits methods from the following classes −
Java.io.FilterInputStream
Java.io.Object