title: How do I use unread() in PushBackBufferedInputStream after the stream is empty?
body: <p>Making a Lexical Analyzer in Java and I'm using PushbackInputStream because I need to be able to push back what I read in case it's not what I wanted. But whenever the stream is empty and read() returns -1. It doesn't allow me to use unread().</p>
  
  <p>EDIT: I'm currently using a regular InputStream, reading it all at once, putting it into a stack, and using  the stack as the stream so I can pop() and push() items on it.</p>