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().
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.