ungetc

InputStreamReader.markSupported is false

Hello, I need to “un-read” characters from an InputStreamReader. For that purpose I wanted to use mark and reset but markSupported returns false for the InputStreamReader class, since it doesn’t maintain an internal buffer and/or queue of characters. I know about BufferedInputStream and PushbackInputStream but neither is appropriate he...

ungetc in Python

Some file read (readlines()) functions in Python copy the file contents to memory (as a list) I need to process a file that's too large to be copied in memory and as such need to use a file pointer (to access the file one byte at a time) -- as in C getc(). The additional requirement I have is that I'd like to rewind the file pointe...