Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2014-01-25 Thread Max Leske
So in favor of not modifying ReadStream I implemented your suggestion #binaryReadStream in Filesystem (will not work on all streams now but that’s ok for me until we get Xstreams). Please take a look and let me know what you think (ReadStream would have been 2 methods only vs. ~6 :) ). Name:

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-10 Thread Damien Cassou
On Dec 5, 2013 10:50 PM, Max Leske maxle...@gmail.com wrote: There are several different approaches in different places: - FileStream reads strings by default. #binary and #ascii switch between formats. File streams use an internal buffer which is either a String (default) or a ByteArray. It’s

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-10 Thread Nicolas Cellier
The more you add, the more you'll have to remove 2013/12/10 Damien Cassou damien.cas...@gmail.com On Dec 5, 2013 10:50 PM, Max Leske maxle...@gmail.com wrote: There are several different approaches in different places: - FileStream reads strings by default. #binary and #ascii switch

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-06 Thread Nicolas Cellier
Hem, switching #ascii - #binary does only make sense in... ASCII With every other encoding, it's not something that makes sense at all, or maybe #latin1 - #binary, #utf8 - #binary, #utf16 - #binary 2013/12/5 Max Leske maxle...@gmail.com There are several different approaches in different

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-06 Thread Max Leske
I agree but that is a problem inherent to the current implementation and it’s not really my goal now to fix all the shortcomings :) I simply want a consistent way to get through this (since I’ve heard that the streams might be replaced with Xtreams…). On 07.12.2013, at 00:44, Nicolas Cellier

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-05 Thread Henrik Johansen
On 05 Dec 2013, at 7:48 , Max Leske maxle...@gmail.com wrote: Thanks for the input. The problem with ReadStream and WriteStream is that they (at least in 2.0 and 3.0) never supported switching in the first place. #binary and #ascii simply answer self. That means the collection the stream

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-05 Thread Max Leske
On 05.12.2013, at 10:12, Henrik Johansen henrik.s.johan...@veloxit.no wrote: On 05 Dec 2013, at 7:48 , Max Leske maxle...@gmail.com wrote: Thanks for the input. The problem with ReadStream and WriteStream is that they (at least in 2.0 and 3.0) never supported switching in the first

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-05 Thread Max Leske
There are several different approaches in different places: - FileStream reads strings by default. #binary and #ascii switch between formats. File streams use an internal buffer which is either a String (default) or a ByteArray. It’s even possible to switch between binary and ascii midstream

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-04 Thread Max Leske
Let me see what I can come up with. 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

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-04 Thread Sven Van Caekenberghe
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).

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-04 Thread Nicolas Cellier
Here would be the Xtream way IMHO: 1) At the end, the file should be handled as binary. 2) A facade BivalentReadStream (and BivalentWriteStream) would be created, able to switch encoding 3) The implementation would be to wrap either directly over the binary stream, or indirectly over an encoded

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-04 Thread Max Leske
Thanks for the input. The problem with ReadStream and WriteStream is that they (at least in 2.0 and 3.0) never supported switching in the first place. #binary and #ascii simply answer self. That means the collection the stream operates on predetermines the output. I’ve noticed a couple of

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-04 Thread Stéphane Ducasse
On Dec 5, 2013, at 7:48 AM, Max Leske maxle...@gmail.com wrote: Thanks for the input. The problem with ReadStream and WriteStream is that they (at least in 2.0 and 3.0) never supported switching in the first place. #binary and #ascii simply answer self. That means the collection the

Re: [Pharo-dev] 12259: FileSystem memory reads writesusing a binary stream by default

2013-12-03 Thread Damien Cassou
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,