<div class="gmail_quote">On Wed, Jul 8, 2009 at 2:42 PM, Robert Špalek <span dir="ltr"><<a href="mailto:rspalek@gmail.com">rspalek@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote">On Tue, Jul 7, 2009 at 5:34 PM,  <span dir="ltr"><<a href="mailto:dkasak13@users.sourceforge.net" target="_blank">dkasak13@users.sourceforge.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


+               // Account for GPL jump that some commands set<br>
+               reader.seek(reader.pos() + _jump);<br></blockquote></div><div><br></div>not sure how efficient the stream reader is, i.e. whether it tests the new position for inequality or whether it always refills its buffers.  maybe it would be nicer to test if (_jump != 0) { ... }<div>


</div></blockquote><div><br>Additionally, if we're talking about a standard stream reader here (i.e. derived from SeekableReadStream), then the seek method has an optional second parameter that can be used to specify that the offset is relative, rather than absolute. So a cleaner implementation would be:<br>
<br>if (_jump != 0)<br>     reader.seek(_jump, SEEK_CUR);<br> </div></div>Paul.<br>