With the different character encodings out there (utf8, utf16, ascii) you cannot reliably seek forward and backward in the stream once you have surrogate characters. Bear that in mind before you try to implement a generic seeking solution. You've already gotten full solutions in your other thread so there's no point in explaining anything new here