<div dir="auto">WebClient could keep an own buffer to simulate repeated streaming.<div dir="auto"><br></div><div dir="auto">ByteArray contents would be more sensible in general.</div><div dir="auto"><br></div><div dir="auto">As would be reading bytes from file streams by default, but somehow legacy has left us with text streams as the default.</div><div dir="auto"><br></div><div dir="auto">Are you willing to change the WebClient interface incompatibly to do the right thing?</div><div dir="auto"><br></div><div dir="auto">Also, does WebClient decode actual text correctly? For example, if the server sends UTF-8 or -16 do we get the correct codepoints? Or do we get a byte array of type ByteString?</div><div dir="auto"><br></div><div dir="auto">Kind regards</div><div dir="auto">Jakob</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Tobias Pape <<a href="mailto:Das.Linux@gmx.de">Das.Linux@gmx.de</a>> schrieb am Fr., 13. Dez. 2019, 11:36:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On 13.12.2019, at 11:23, Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de" target="_blank" rel="noreferrer">marcel.taeumel@hpi.de</a>> wrote:<br>
> <br>
> Hi, there!<br>
> <br>
> I can easily fetch some graphics from the Web:<br>
> <br>
> response := WebClient httpGet: '<a href="https://upload.wikimedia.org/wikipedia/en/e/ef/Commander_Keen_cover_art.jpeg" rel="noreferrer noreferrer" target="_blank">https://upload.wikimedia.org/wikipedia/en/e/ef/Commander_Keen_cover_art.jpeg</a>'.<br>
> <br>
> However, the #content in this WebResponse is a ByteString even though the content-type is image/jpeg. I would expect the #content to be a ByteArray.<br>
> <br>
> content := response content.<br>
> <br>
> Because of this, I have to explicitely convert it before ImageReadWriter can work its magic:<br>
> <br>
> form := ImageReadWriter formFromStream: content asByteArray readStream.<br>
> <br>
> That's inconvenient. Maybe even a bug? Don't know.<br>
> <br>
> Best,<br>
> Marcel<br>
> <br>
> P.S.: Why doesn't SecureSocketStream respond to #reset? I cannot do this:<br>
> <br>
> ImageReadWriter formFromStream:<br>
>             (WebClient httpGet: '<a href="https://upload.wikimedia.org/wikipedia/en/e/ef/Commander_Keen_cover_art.jpeg" rel="noreferrer noreferrer" target="_blank">https://upload.wikimedia.org/wikipedia/en/e/ef/Commander_Keen_cover_art.jpeg</a>')<br>
>                          contentStream.<br>
> <br>
<br>
<br>
Simply because you cannot un-receive a network message. <br>
-t<br>
<br>
<br>
</blockquote></div>