On 04 Dec 2013, at 13:14, Max Leske <maxle...@gmail.com> wrote:

> Let me see what I can come up with.

To be somewhat compatible with existing streams, your memory stream should have 
the concept of ‘i am binary or textual’ and be able to switch in-place between 
these two states (#binary, #ascii). Depending on its state it should then 
return bytes or characters (or collections thereof). Have a look at 
ZnLimitedReadStream>>#next and/or ZnBivalentWriteStream>>#nextPut:

To be 100% correct, encoding should be selectable. But maybe a default to utf-8 
would be enough. You could have a look at ZnCharacter[Read|Write]Stream for 
inspiration.

My 2c.

> On 03.12.2013, at 19:36, Damien Cassou <damien.cas...@gmail.com> wrote:
> 
>> Thanks Max for the report. Do you have an idea on how we could solve the 
>> problem ? The previous behaviour was not acceptable either because the 
>> streams that came out of a memory filesystem were the only ones with binary 
>> content
>> 
>> On Dec 3, 2013 5:35 PM, "Max Leske" <maxle...@gmail.com> wrote:
>> Damien, Marcus
>> 
>> this change breaks a lot of things in FileSystem-Git. I don’t disagree with 
>> the idea that reading characters should be default (one could argue about 
>> it…) but your change makes it IMPOSSIBLE to read bytes because unprintable 
>> characters are discarded! So if my ByteArray is a NULL terminated string, 
>> for instance, I can not check for the NULL termination anymore.
>> 
>> Cheers,
>> Max
> 


Reply via email to