[FIX] ZipArchive - Cant read from ReadWriteStreams

Russell Penney russell.penney at tincanct.com
Tue Jul 27 08:57:00 UTC 2004


Stef,
	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.

Russell

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak-dev-
> bounces at lists.squeakfoundation.org] On Behalf Of stéphane ducasse
> Sent: Tuesday, 27 July 2004 4:23 AM
> To: The general-purpose Squeak developers list
> Subject: Re: [FIX] ZipArchive - Cant read from ReadWriteStreams
> 
> Hi russel
> 
> 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.
> 
> Stef
> 
> On 26 juil. 04, at 16:35, Russell Penney wrote:
> 
> > 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.
> >
> >
> >
> > Try:
> >
> > | buffer |
> >
> >
> >
> > s := StandardFileStream readOnlyFileNamed: 'somefile.zip'.
> >
> > s binary.
> >
> > buffer := s contents.
> >
> > s close.
> >
> > s := ReadWriteStream with: buffer.
> >
> > s reset.
> >
> > ZipArchive new readFrom: s.
> >
> >
> >
> >
> > <ZipArchiveChanges.1.cs>
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ZipArchiveChanges.3.cs
Type: application/octet-stream
Size: 7573 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040727/2da2556a/ZipArchiveChanges.3.obj


More information about the Squeak-dev mailing list