stream not working with MemoryFileSystemFile
Hello, I tried to create an in-memory file as following: (MemoryFileSystemFile named: 'Foo') writeStreamDo: [ :stream | stream nextPutAll: 'bar' ] Then I get an improper store into ByteArray. It looks like Character cannot be store in a byte array. I do not know if the bug is on the memory file system part or other. Any idea? Christophe
I'd suspect from MemoryFileSystemFile . Some time ago I worked with the memory FileSystem and it was a bit buggy. On Wed, Jul 1, 2015 at 2:09 PM, Christophe Demarey < Christophe.Demarey@inria.fr> wrote:
Hello,
I tried to create an in-memory file as following: (MemoryFileSystemFile named: 'Foo') writeStreamDo: [ :stream | stream nextPutAll: 'bar' ]
Then I get an improper store into ByteArray. It looks like Character cannot be store in a byte array. I do not know if the bug is on the memory file system part or other. Any idea?
Christophe
I think it is by design, you can just wrap the binary stream with a ZnCharacterOutputStream. We should get away from streams that do everything anyway.
On 01 Jul 2015, at 14:09, Christophe Demarey <Christophe.Demarey@inria.fr> wrote:
Hello,
I tried to create an in-memory file as following: (MemoryFileSystemFile named: 'Foo') writeStreamDo: [ :stream | stream nextPutAll: 'bar' ]
Then I get an improper store into ByteArray. It looks like Character cannot be store in a byte array. I do not know if the bug is on the memory file system part or other. Any idea?
Christophe
ok, thanks Le 1 juil. 2015 à 14:55, Sven Van Caekenberghe a écrit :
I think it is by design, you can just wrap the binary stream with a ZnCharacterOutputStream.
We should get away from streams that do everything anyway.
On 01 Jul 2015, at 14:09, Christophe Demarey <Christophe.Demarey@inria.fr> wrote:
Hello,
I tried to create an in-memory file as following: (MemoryFileSystemFile named: 'Foo') writeStreamDo: [ :stream | stream nextPutAll: 'bar' ]
Then I get an improper store into ByteArray. It looks like Character cannot be store in a byte array. I do not know if the bug is on the memory file system part or other. Any idea?
Christophe
participants (3)
-
Christophe Demarey -
Martin Dias -
Sven Van Caekenberghe