File: zlib.texi

package info (click to toggle)
gnu-smalltalk 3.1-6
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 33,300 kB
  • ctags: 13,999
  • sloc: ansic: 88,106; sh: 23,223; asm: 7,889; perl: 4,493; cpp: 3,539; awk: 1,483; yacc: 1,355; xml: 1,272; makefile: 1,192; lex: 843; sed: 258; objc: 124
file content (706 lines) | stat: -rw-r--r-- 15,648 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
@c Define the class index, method index, and selector cross-reference
@ifclear CLASS-INDICES
@set CLASS-INDICES
@defindex cl
@defcodeindex me
@defcodeindex sl 
@end ifclear

@c These are used for both TeX and HTML
@set BEFORE1
@set  AFTER1
@set BEFORE2
@set  AFTER2

@ifinfo
@c Use asis so that leading and trailing spaces are meaningful.
@c Remember we're inside a @menu command, hence the blanks are
@c kept in the output.
@set BEFORE1 @asis{* }
@set  AFTER1 @asis{::}
@set BEFORE2 @asis{  (}
@set  AFTER2 @asis{)}
@end ifinfo

@macro class {a,b}
@value{BEFORE1}\a\\a\@b{\b\}@value{AFTER1}
@end macro
@macro superclass {a,b}
\a\\a\@value{BEFORE2}@i{\b\}@value{AFTER2}
@end macro

@ifnotinfo
@macro begindetailmenu
@display
@end macro
@macro enddetailmenu
@end display
@end macro
@end ifnotinfo

@ifinfo
@macro begindetailmenu
@detailmenu
@end macro
@macro enddetailmenu
@end detailmenu
@end macro
@end ifinfo

@iftex
@macro beginmenu
@end macro
@macro endmenu
@end macro
@end iftex

@ifnottex
@macro beginmenu
@menu
@end macro
@macro endmenu
@end menu
@end macro
@end ifnottex

@beginmenu
@ifnottex
Alphabetic list:
* ZLib.DeflateStream::
* ZLib.DeflateWriteStream::
* ZLib.GZipDeflateStream::
* ZLib.GZipDeflateWriteStream::
* ZLib.GZipInflateStream::
* ZLib.InflateStream::
* ZLib.RawDeflateStream::
* ZLib.RawDeflateWriteStream::
* ZLib.RawInflateStream::
* ZLib.ZlibError::
* ZLib.ZlibReadStream::
* ZLib.ZlibStream::
* ZLib.ZlibWriteStream::
@end ifnottex

@ifinfo
Class tree:
@end ifinfo
@iftex
@section Tree
@end iftex
@ifnotinfo

Classes documented in this manual are @b{boldfaced}.

@end ifnotinfo
@begindetailmenu
@superclass{@t{}, Object}
@superclass{@t{ }, Iterable}
@superclass{@t{  }, Stream}
@class{@t{   }, ZLib.ZlibStream}
@class{@t{    }, ZLib.ZlibReadStream}
@class{@t{     }, ZLib.RawDeflateStream}
@class{@t{      }, ZLib.DeflateStream}
@class{@t{      }, ZLib.GZipDeflateStream}
@class{@t{     }, ZLib.RawInflateStream}
@class{@t{      }, ZLib.GZipInflateStream}
@class{@t{      }, ZLib.InflateStream}
@class{@t{    }, ZLib.ZlibWriteStream}
@class{@t{     }, ZLib.RawDeflateWriteStream}
@class{@t{      }, ZLib.DeflateWriteStream}
@class{@t{      }, ZLib.GZipDeflateWriteStream}
@superclass{@t{ }, Signal}
@superclass{@t{  }, Exception}
@superclass{@t{   }, Error}
@class{@t{    }, ZLib.ZlibError}
@enddetailmenu
@endmenu
@unmacro class
@unmacro superclass
@unmacro endmenu
@unmacro beginmenu
@unmacro enddetailmenu
@unmacro begindetailmenu
@node ZLib.DeflateStream
@section ZLib.DeflateStream
@clindex ZLib.DeflateStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.RawDeflateStream
@itemx Category: Examples-Useful
Instances of this class produce "standard"
(zlib, RFC1950) deflated data.
@end table

@menu
* ZLib.DeflateStream class-instance creation::  (class)
@end menu



@node ZLib.DeflateStream class-instance creation
@subsection ZLib.DeflateStream class:@- instance creation

@table @b
@meindex compressingTo:@-
@slindex nextPut:@-
@item compressingTo:@- aStream
Answer a stream that receives data via @-#nextPut:@- and compresses it onto
aStream.


@meindex compressingTo:@-level:@-
@slindex nextPut:@-
@item compressingTo:@- aStream level:@- level
Answer a stream that receives data via @-#nextPut:@- and compresses it onto
aStream with the given compression level.


@end table

@node ZLib.DeflateWriteStream
@section ZLib.DeflateWriteStream
@clindex ZLib.DeflateWriteStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.RawDeflateWriteStream
@itemx Category: Examples-Useful
Instances of this class produce "standard"
(zlib, RFC1950) deflated data.
@end table

@menu
@end menu

@node ZLib.GZipDeflateStream
@section ZLib.GZipDeflateStream
@clindex ZLib.GZipDeflateStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.RawDeflateStream
@itemx Category: Examples-Useful
Instances of this class produce GZip (RFC1952)
deflated data.
@end table

@menu
* ZLib.GZipDeflateStream class-instance creation::  (class)
@end menu



@node ZLib.GZipDeflateStream class-instance creation
@subsection ZLib.GZipDeflateStream class:@- instance creation

@table @b
@meindex compressingTo:@-
@slindex nextPut:@-
@item compressingTo:@- aStream
Answer a stream that receives data via @-#nextPut:@- and compresses it onto
aStream.


@meindex compressingTo:@-level:@-
@slindex nextPut:@-
@item compressingTo:@- aStream level:@- level
Answer a stream that receives data via @-#nextPut:@- and compresses it onto
aStream with the given compression level.


@end table

@node ZLib.GZipDeflateWriteStream
@section ZLib.GZipDeflateWriteStream
@clindex ZLib.GZipDeflateWriteStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.RawDeflateWriteStream
@itemx Category: Examples-Useful
Instances of this class produce GZip (RFC1952)
deflated data.
@end table

@menu
@end menu

@node ZLib.GZipInflateStream
@section ZLib.GZipInflateStream
@clindex ZLib.GZipInflateStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.RawInflateStream
@itemx Category: Examples-Useful
Instances of this class reinflate GZip (RFC1952)
deflated data.
@end table

@menu
@end menu

@node ZLib.InflateStream
@section ZLib.InflateStream
@clindex ZLib.InflateStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.RawInflateStream
@itemx Category: Examples-Useful
Instances of this class reinflate "standard"
(zlib, RFC1950) deflated data.
@end table

@menu
@end menu

@node ZLib.RawDeflateStream
@section ZLib.RawDeflateStream
@clindex ZLib.RawDeflateStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.ZlibReadStream
@itemx Category: Examples-Useful
Instances of this class produce "raw" (PKZIP)
deflated data.
@end table

@menu
* ZLib.RawDeflateStream class-instance creation::  (class)
@end menu



@node ZLib.RawDeflateStream class-instance creation
@subsection ZLib.RawDeflateStream class:@- instance creation

@table @b
@meindex compressingTo:@-
@slindex nextPut:@-
@item compressingTo:@- aStream
Answer a stream that receives data via @-#nextPut:@- and compresses it onto
aStream.


@meindex compressingTo:@-level:@-
@slindex nextPut:@-
@item compressingTo:@- aStream level:@- level
Answer a stream that receives data via @-#nextPut:@- and compresses it onto
aStream with the given compression level.


@meindex on:@-
@item on:@- aStream
Answer a stream that compresses the data in aStream with the default
compression level.


@meindex on:@-level:@-
@item on:@- aStream level:@- compressionLevel
Answer a stream that compresses the data in aStream with the given
compression level.


@end table

@node ZLib.RawDeflateWriteStream
@section ZLib.RawDeflateWriteStream
@clindex ZLib.RawDeflateWriteStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.ZlibWriteStream
@itemx Category: Examples-Useful
Instances of this class produce "raw" (PKZIP)
deflated data.
@end table

@menu
* ZLib.RawDeflateWriteStream class-instance creation::  (class)
@end menu



@node ZLib.RawDeflateWriteStream class-instance creation
@subsection ZLib.RawDeflateWriteStream class:@- instance creation

@table @b
@meindex on:@-
@item on:@- aWriteStream
Answer a stream that compresses the data in aStream with the default
compression level.


@meindex on:@-level:@-
@item on:@- aWriteStream level:@- compressionLevel
Answer a stream that compresses the data in aStream with the given
compression level.


@end table

@node ZLib.RawInflateStream
@section ZLib.RawInflateStream
@clindex ZLib.RawInflateStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.ZlibReadStream
@itemx Category: Examples-Useful
Instances of this class reinflate "raw" (PKZIP)
deflated data.
@end table

@menu
* ZLib.RawInflateStream-positioning::  (instance)
@end menu



@node ZLib.RawInflateStream-positioning
@subsection ZLib.RawInflateStream:@- positioning

@table @b
@meindex copyFrom:@-to:@-
@slindex position
@item copyFrom:@- start to:@- end
Answer the data on which the receiver is streaming, from
the start-th item to the end-th.  Note that this method is 0-based,
unlike the one in Collection, because a Stream's @-#position method
returns 0-based values.  Notice that this class can only provide
the illusion of random access, by appropriately rewinding the input
stream or skipping compressed data.


@meindex isPositionable
@slindex skip:@-
@item isPositionable
Answer true if the stream supports moving backwards with @-#skip:@-.


@meindex position:@-
@item position:@- anInteger
Set the current position in the stream to anInteger.  Notice that this
class can only provide the illusion of random access, by appropriately
rewinding the input stream or skipping compressed data.


@meindex reset
@item reset
Reset the stream to the beginning of the compressed data.


@meindex skip:@-
@item skip:@- anInteger
Move the current position by anInteger places, either forwards or
backwards.


@end table

@node ZLib.ZlibError
@section ZLib.ZlibError
@clindex ZLib.ZlibError

@table @b
@item Defined in namespace ZLib
@itemx Superclass: Error
@itemx Category: Examples-Useful
This exception is raised whenever there is an error
in a compressed stream.
@end table

@menu
* ZLib.ZlibError-accessing::  (instance)
@end menu



@node ZLib.ZlibError-accessing
@subsection ZLib.ZlibError:@- accessing

@table @b
@meindex stream
@item stream
Answer the ZlibStream that caused the error.


@meindex stream:@-
@item stream:@- anObject
Set the ZlibStream that caused the error.


@end table

@node ZLib.ZlibReadStream
@section ZLib.ZlibReadStream
@clindex ZLib.ZlibReadStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.ZlibStream
@itemx Category: Examples-Useful
This abstract class implements the basic buffering that is
used for communication with zlib.
@end table

@menu
* ZLib.ZlibReadStream-accessing-reading::  (instance)
* ZLib.ZlibReadStream-streaming::  (instance)
@end menu



@node ZLib.ZlibReadStream-accessing-reading
@subsection ZLib.ZlibReadStream:@- accessing-reading

@table @b
@meindex nextAvailable:@-into:@-startingAt:@-
@item nextAvailable:@- anInteger into:@- aCollection startingAt:@- pos
Place up to anInteger objects from the receiver into
aCollection, starting from position pos and stopping if
no more data is available.


@meindex nextAvailable:@-putAllOn:@-
@item nextAvailable:@- anInteger putAllOn:@- aStream
Copy up to anInteger objects from the receiver to
aStream, stopping if no more data is available.


@end table



@node ZLib.ZlibReadStream-streaming
@subsection ZLib.ZlibReadStream:@- streaming

@table @b
@meindex atEnd
@item atEnd
Answer whether the stream has got to an end


@meindex next
@item next
Return the next object (character or byte) in the receiver.


@meindex peek
@item peek
Returns the next element of the stream without moving the pointer.
Returns nil when at end of stream.


@meindex peekFor:@-
@item peekFor:@- anObject
Returns true and gobbles the next element from the stream of it is
equal to anObject, returns false and doesn't gobble the next element
if the next element is not equal to anObject.


@meindex position
@item position
Answer the current value of the stream pointer.  Note that only inflating
streams support random access to the stream data.


@end table

@node ZLib.ZlibStream
@section ZLib.ZlibStream
@clindex ZLib.ZlibStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: Stream
@itemx Category: Examples-Useful
This abstract class implements the basic interface to
the zlib module.  Its layout matches what is expected by the C code.
@end table

@menu
* ZLib.ZlibStream class-accessing::  (class)
* ZLib.ZlibStream class-instance creation::  (class)
* ZLib.ZlibStream-streaming::  (instance)
@end menu



@node ZLib.ZlibStream class-accessing
@subsection ZLib.ZlibStream class:@- accessing

@table @b
@meindex bufferSize
@item bufferSize
Answer the size of the output buffers that are passed to zlib.  Each
zlib stream uses a buffer of this size.


@meindex bufferSize:@-
@item bufferSize:@- anInteger
Set the size of the output buffers that are passed to zlib.  Each
zlib stream uses a buffer of this size.


@meindex defaultCompressionLevel
@item defaultCompressionLevel
Return the default compression level used by deflating streams.


@meindex defaultCompressionLevel:@-
@item defaultCompressionLevel:@- anInteger
Set the default compression level used by deflating streams.  It
should be a number between 1 and 9.


@end table



@node ZLib.ZlibStream class-instance creation
@subsection ZLib.ZlibStream class:@- instance creation

@table @b
@meindex new
@item new
This method should not be called for instances of this class.

@meindex on:@-
@item on:@- aStream
Answer an instance of the receiver that decorates aStream.


@end table



@node ZLib.ZlibStream-streaming
@subsection ZLib.ZlibStream:@- streaming

@table @b
@meindex isExternalStream
@item isExternalStream
Answer whether the receiver streams on a file or socket.


@meindex name
@item name
Return the name of the underlying stream.


@meindex species
@slindex upTo:@-
@item species
Return the type of the collections returned by @-#upTo:@- etc.


@meindex stream
@item stream
Answer the wrapped stream.


@end table

@node ZLib.ZlibWriteStream
@section ZLib.ZlibWriteStream
@clindex ZLib.ZlibWriteStream

@table @b
@item Defined in namespace ZLib
@itemx Superclass: ZLib.ZlibStream
@itemx Category: Examples-Useful
This abstract class implements the basic buffering
that is used for communication with zlib in a WriteStream decorator.
@end table

@menu
* ZLib.ZlibWriteStream-streaming::  (instance)
@end menu



@node ZLib.ZlibWriteStream-streaming
@subsection ZLib.ZlibWriteStream:@- streaming

@table @b
@meindex close
@item close
Finish the deflated output to the destination stream using Z_FINISH.
The destination stream is closed, which implies flushing.


@meindex contents
@slindex contents
@item contents
Finish the deflated output to the destination stream using Z_FINISH and
return the deflated data (requires the destination stream to support
@-#contents).


@meindex finish
@item finish
Finish the deflated output to the destination stream using Z_FINISH.
The destination stream is not flushed.


@meindex flush
@item flush
Flush the deflated output to the destination stream, and flush the
destination stream.


@meindex flushBuffer
@item flushBuffer
Flush the deflated output to the destination stream.


@meindex flushDictionary
@item flushDictionary
Flush the deflated output to the destination stream using Z_FULL_FLUSH,
and flush the destination stream.


@meindex next:@-putAll:@-startingAt:@-
@item next:@- n putAll:@- aCollection startingAt:@- pos
Put n characters or bytes of aCollection, starting at the pos-th,
in the deflation buffer.


@meindex nextPut:@-
@item nextPut:@- aByte
Append a character or byte (depending on whether the destination
stream works on a ByteArray or String) to the deflation buffer.


@meindex partialFlush
@item partialFlush
Flush the deflated output to the destination stream using Z_PARTIAL_FLUSH,
and flush the destination stream.


@meindex position
@item position
Answer the number of compressed bytes written.


@meindex readStream
@slindex readStream
@item readStream
Finish the deflated output to the destination stream using Z_FINISH and
return a ReadStream on the deflated data (requires the destination
stream to support @-#readStream).


@meindex syncFlush
@item syncFlush
Flush the deflated output to the destination stream using Z_SYNC_FLUSH,
and flush the destination stream.  Note that this includes the four
bytes 0/0/255/255 at the end of the flush.


@end table