<div dir="ltr"><div><div>I just hate those read/write streams, there are unecessarily complex, behaving quite randomly as underlined by tim, and 99% of time unecessary at all.<br></div>Here you just need a write stream, clearly.<br>
</div>Xtreams has no read/write stream.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/3 tim Rowledge <span dir="ltr">&lt;<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This seems to be something that crops up every now and then and I&#39;m never sure I&#39;ve really worked it out fully. Typically I seem to recall arguments about what a WriteStream should return for contents.<br>

<br>
FileStream carefully sets its read position to 0, gets the contents (which is from read position to end) and resets the read position<br>
InflateStream does upToEnd<br>
PositionableStream does 1 to read limit<br>
RWBinaryOrTextStream (love those class names…) does 1 to max of read limit &amp; position<br>
ReadWriteStream does similar, as does WriteStream<br>
<br>
Since MultiByteBinaryOrTextStream is a subclass of ReadWriteStream I&#39;d say it ought to behave similarly when possible. Right now using upToEnd is the &#39;problem&#39; so a quick test would be to just &#39;self position: 0&#39; before the upToEnd. The converter fudging after the read will return the position to whatever it was at the beginning, so that is all covered.<br>

<br>
Then track down all senders and make sure they aren&#39;t going to be messed up by your change….<br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" target="_blank">http://www.rowledge.org/tim</a><br>
Useful random insult:- Has a pulse, but that&#39;s about all.<br>
<br>
<br>
<br>
</blockquote></div><br></div>