Issue 266 in glassdb: GemStone-ANSI-Streams of GsCore 0.245 does not agree with Zip implementation

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

Issue 266 in glassdb: GemStone-ANSI-Streams of GsCore 0.245 does not agree with Zip implementation

glassdb
Status: Accepted
Owner: [hidden email]
Labels: Type-Defect Priority-Medium GLASS-Server Version-2.4.x  
Version-1.0-beta.9 Package-GsCore

New issue 266 by [hidden email]: GemStone-ANSI-Streams of GsCore  
0.245 does not agree with Zip implementation
http://code.google.com/p/glassdb/issues/detail?id=266

What steps will reproduce the problem?
1. use a ByteArray of a Zip-File
2. do #readStream on it and you get an AnsiReadStream
3. initializing a ZipArchive from this Stream does not work, as the Zip  
implementation relies on the 0-indexed ReadStream behavior.

Possible solutions:
* modify Zip implementation to double-dispatch on the stream
* have a different (or altered), ANSI-Stream-compatible Zip-implementation  
loaded via GsCore

I would like to help there.

Reply | Threaded
Open this post in threaded view
|

Re: Issue 266 in glassdb: GemStone-ANSI-Streams of GsCore 0.245 does not agree with Zip implementation

glassdb

Comment #1 on issue 266 by [hidden email]: GemStone-ANSI-Streams of  
GsCore 0.245 does not agree with Zip implementation
http://code.google.com/p/glassdb/issues/detail?id=266

The following works:

        file := "contents of a file as String"
        array := file asByteArray.
        stream := ReadStream on: array.
        reader := MCMczReader on: stream.
        dep := reader info.

while the following does not:

        file := "contents of a file as String"
        array := file asByteArray.
        stream := AnsiReadStream on: array.
        reader := MCMczReader on: stream.
        dep := reader info.

and subsequently, the following does not work with GsCore 0.245


        file := "contents of a file as String"
        array := file asByteArray.
        stream := array readStream
        reader := MCMczReader on: stream.
        dep := reader info.

as readStream is now returning an AnsiReadStream.
http://code.google.com/p/glassdb/issues/detail?id=166#c8 is related.

Reply | Threaded
Open this post in threaded view
|

Re: Issue 266 in glassdb: GemStone-ANSI-Streams of GsCore 0.245 does not agree with Zip implementation

glassdb
Updates:
        Labels: -Version-1.0-beta.9 Version-1.0-beta.8.6

Comment #2 on issue 266 by [hidden email]: GemStone-ANSI-Streams of  
GsCore 0.245 does not agree with Zip implementation
http://code.google.com/p/glassdb/issues/detail?id=266

(No comment was entered for this change.)

Reply | Threaded
Open this post in threaded view
|

Re: Issue 266 in glassdb: GemStone-ANSI-Streams of GsCore 0.245 does not agree with Zip implementation

glassdb

Comment #3 on issue 266 by [hidden email]: GemStone-ANSI-Streams of  
GsCore 0.245 does not agree with Zip implementation
http://code.google.com/p/glassdb/issues/detail?id=266

Patching  ZipArchive>>#readFrom:


readFrom: aStreamOrFileName
        | stream name eocdPosition |
        stream := aStreamOrFileName isStream
                ifTrue: [
                        name := aStreamOrFileName name.
                        aStreamOrFileName]
                ifFalse: [self error: 'from fileName not implemented yet'].
+ (stream isKindOf: AnsiReadStream)
+ ifTrue: [stream := ReadStream on: stream _collection].
        stream binary.
        eocdPosition := self class findEndOfCentralDirectoryFrom: stream.
        eocdPosition <= 0 ifTrue: [self error: 'can''t find EOCD position'].
        self readEndOfCentralDirectoryFrom: stream.
        stream position: eocdPosition - centralDirectorySize.
        self readMembersFrom: stream named: name

helps.

Reply | Threaded
Open this post in threaded view
|

Re: Issue 266 in glassdb: GemStone-ANSI-Streams of GsCore 0.245 does not agree with Zip implementation

glassdb
Updates:
        Labels: Milestone-1.0-beta.8.7

Comment #4 on issue 266 by [hidden email]: GemStone-ANSI-Streams of  
GsCore 0.245 does not agree with Zip implementation
http://code.google.com/p/glassdb/issues/detail?id=266

(No comment was entered for this change.)

Reply | Threaded
Open this post in threaded view
|

Re: Issue 266 in glassdb: GemStone-ANSI-Streams of GsCore 0.245 does not agree with Zip implementation

glassdb
Updates:
        Labels: -Milestone-1.0-beta.8.7

Comment #5 on issue 266 by [hidden email]: GemStone-ANSI-Streams of  
GsCore 0.245 does not agree with Zip implementation
http://code.google.com/p/glassdb/issues/detail?id=266

I would prefer to fix this particular bug by eliminating the use of  
LegacyStreams (the ones with a different position offset) ... My plans are  
to convert GLASS to consistently use Streams that are completely compatible  
with Pharo and code like this will have to be removed When ANSIStreams are  
functional ....