PushbackInputStream

The PushbackInputStream class provides a pushback
buffer so a program can "unread" bytes onto the stream. These may
be bytes the program has read from the stream or they may be bytes
that come from somewhere else. The next time data is read from the
stream, the "unread" bytes are read.

Although both PushbackInputStream and BufferedInputStream use buffers, only a PushbackInputStream allows unreading and only a BufferedInputStream allows marking and resetting. In a
PushbackInputStreammarkSupported()
returns false.

The read() and available() methods work
as with normal input streams. However, they first attempt
to read from the pushback buffer.