stream not working with MemoryFileSystemFile

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

stream not working with MemoryFileSystemFile

demarey
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

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: stream not working with MemoryFileSystemFile

tinchodias
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 <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: stream not working with MemoryFileSystemFile

Sven Van Caekenberghe-2
In reply to this post by demarey
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 <[hidden email]> 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


Reply | Threaded
Open this post in threaded view
|

Re: stream not working with MemoryFileSystemFile

demarey
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 <[hidden email]> 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
>
>


smime.p7s (5K) Download Attachment