Mantis - Squeak
Viewing Issue Advanced Details
1606 System minor always 08-04-05 00:49 03-02-06 09:25
Russell Penney  
none 3.8  
0001606: [FIX] ZipArchive - Cant read from ReadWriteStreams
Fixes a problem I found with ZipArchive not being able to read from a
ReadWriteStream. Removes any dependence on String internally, which seemed
strange as it forces the input stream to binary before reading. FileStream
does something different to ReadWriteStreams.



| buffer |


s := StandardFileStream readOnlyFileNamed: ''.

s binary.

buffer := s contents.

s close.

s := ReadWriteStream with: buffer.

s reset.

ZipArchive new readFrom: s.
 ZipArchiveChanges.1.cs.gz [^] (1,346 bytes) 08-04-05 00:49
 ZipArchiveChanges.3.cs.gz [^] (2,982 bytes) 08-04-05 00:52

08-04-05 00:51   
=?ISO-8859-1?Q?st=E9phane_ducasse?= <>:

"thanks for your fix. (If I ask nicely may be this will work) would it
be possible to get one or two unit tests so that we can nicely document
your bug and in the same time create active documentation for squeak."
08-04-05 00:51   
"Russell Penney" <>:

    Here you go. :)

The change set consists of the fix and the tests. They show the difference
between ReadWriteStream and StandardFileStream. Actually the bug is in the
next:into:startingAt: method in one of those two streams.
StandardFileStream's method only works on Strings while ReadWriteStream can
handle any array.

One of the tests leaves a zip file in your current directory."

(attaching ZipArchiveChanges.3.cs.gz)
08-04-05 00:53   
I was able to load both changesets (separately) into a 3.8-6665-basic image without errors. The tests included with the second changeset ran succesfully. I did not test this further.
02-24-06 21:15   
not reproducable in 3.9a: added the test, runs green.
03-01-06 21:34   
This is fixed in 3.8 and 3.9; there were a number of fixes needed due to the m18n effort.