On Tue, 20 Mar 2001, Mathieu Bouchard wrote: > Here's a first attempt to something precise: > > A Compressor includes the module CompressorInterface. Construction > is done with .new with one argument called "target", an object > which supports #write. Configuration of impl-dependent options is > done by, um, impl-dependent means. Data is written using > #write(data) which is used like IO's. That method compresses as > much data as it can and calls target.write. > > The reality is that although many compression algorithms can work on > streams, that is, they only have to buffer a small, O(1) part of the file > at once. Some others (notably bzip2) want direct access to the whole file, > so if you could pipe data to it, it'd keep a O(n) buffer. This should > affect a lot the way you design the interface in the end. > So maybe we need a distinction between StreamCompressor and BlockCompressor then? Is there some common interface they share? Is this truning into an micro-increment, iterative, on-line DesignFest? :-) /Robert