title: Writing unicode/utf-8 data to a memory file
body: <p>How can one write unicode/utf-8 to a file in MemoryStore?</p>
  
  <p>Normally I can just do the following</p>
  
  <pre><code>fs := FileSystem workingDirectory.
  file := fs / 'file.txt'.
  file writeStreamDo: [ :stream | stream &lt;&lt; '彼得' ].
  file contents. "'彼得'"
  </code></pre>
  
  <p>the <code>stream</code> there is a <code>MultiByteFileStream</code>.</p>
  
  <p>However when I try to do the same on memory storage, I and up with an error</p>
  
  <pre><code>fs := FileSystem memory.
  file := fs / 'file.txt'.
  file writeStreamDo: [ :stream | stream &lt;&lt; '彼得' ].
  </code></pre>
  
  <blockquote>
    <p>Error: Improper store into indexable object</p>
  </blockquote>
  
  <p>Because <code>stream</code> there is an ordinary <code>WriteStream</code>.</p>
  
  <p>I've tried to work around it by directly instantiating <code>MultiByteFileStream</code>, however that seems to require real file.</p>
  
  <p>Is there another way?</p>