I'm working on a finite state machine that processes a file byte by byte, 
without loading the entire file into memory. Currently it works in the 
forward direction, but I'd like to get it working in the reverse direction 
as well. Currently I make a *bufio.Readerfrom a open file / response body 
and then use ReadByte() to get each byte from beginning to end.


I'm wondering, what is the best way to get each byte starting from the end 
and going to the beginning? My first idea to read backwards is to use a 
combination of UnreadByte() and Peek(1) to read in reverse after advancing 
the reader to the end. I'd like to avoid reading in the whole file into 
memory.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to