Class: Zlib::GzipFile
- Inherits:
-
Object
- Object
- Zlib::GzipFile
- Defined in:
- zlib.c,
zlib.c
Overview
Zlib::GzipFile is an abstract class for handling a gzip formatted compressed file. The operations are defined in the subclasses, Zlib::GzipReader for reading, and Zlib::GzipWriter for writing.
GzipReader should be used by associating an IO, or IO-like, object.
Direct Known Subclasses
Defined Under Namespace
Classes: CRCError, Error, LengthError, NoFooter
Class Method Summary collapse
-
.wrap ⇒ Object
See Zlib::GzipReader#wrap and Zlib::GzipWriter#wrap.
Instance Method Summary collapse
-
#close ⇒ Object
Closes the GzipFile object.
-
#closed? ⇒ Boolean
Same as IO.
-
#comment ⇒ Object
Returns comments recorded in the gzip file header, or nil if the comments is not present.
-
#crc ⇒ Object
Returns CRC value of the uncompressed data.
-
#finish ⇒ Object
Closes the GzipFile object.
-
#level ⇒ Object
Returns compression level.
-
#mtime ⇒ Object
Returns last modification time recorded in the gzip file header.
-
#orig_name ⇒ Object
Returns original filename recorded in the gzip file header, or
nilif original filename is not present. -
#os_code ⇒ Object
Returns OS code number recorded in the gzip file header.
-
#sync ⇒ Object
Same as IO.
-
#sync=(flag) ⇒ Object
Same as IO.
-
#to_io ⇒ Object
Same as IO.
Class Method Details
.wrap ⇒ Object
See Zlib::GzipReader#wrap and Zlib::GzipWriter#wrap.
2332 2333 2334 |
# File 'zlib.c', line 2332 static VALUE rb_gzfile_s_wrap(argc, argv, klass) int argc; |
Instance Method Details
#close ⇒ Object
Closes the GzipFile object. This method calls close method of the associated IO object. Returns the associated IO object.
2549 2550 2551 |
# File 'zlib.c', line 2549 static VALUE rb_gzfile_close(obj) VALUE obj; |
#closed? ⇒ Boolean
Same as IO.
2581 2582 2583 |
# File 'zlib.c', line 2581 static VALUE rb_gzfile_closed_p(obj) VALUE obj; |
#comment ⇒ Object
Returns comments recorded in the gzip file header, or nil if the comments is not present.
2441 2442 2443 |
# File 'zlib.c', line 2441 static VALUE rb_gzfile_comment(obj) VALUE obj; |
#crc ⇒ Object
Returns CRC value of the uncompressed data.
2384 2385 2386 |
# File 'zlib.c', line 2384 static VALUE rb_gzfile_crc(obj) VALUE obj; |
#finish ⇒ Object
Closes the GzipFile object. Unlike Zlib::GzipFile#close, this method never calls the close method of the associated IO object. Returns the associated IO object.
2566 2567 2568 |
# File 'zlib.c', line 2566 static VALUE rb_gzfile_finish(obj) VALUE obj; |
#level ⇒ Object
Returns compression level.
2404 2405 2406 |
# File 'zlib.c', line 2404 static VALUE rb_gzfile_level(obj) VALUE obj; |
#mtime ⇒ Object
Returns last modification time recorded in the gzip file header.
2394 2395 2396 |
# File 'zlib.c', line 2394 static VALUE rb_gzfile_mtime(obj) VALUE obj; |
#orig_name ⇒ Object
Returns original filename recorded in the gzip file header, or nil if original filename is not present.
2425 2426 2427 |
# File 'zlib.c', line 2425 static VALUE rb_gzfile_orig_name(obj) VALUE obj; |
#os_code ⇒ Object
Returns OS code number recorded in the gzip file header.
2414 2415 2416 |
# File 'zlib.c', line 2414 static VALUE rb_gzfile_os_code(obj) VALUE obj; |
#sync ⇒ Object
Same as IO.
2604 2605 2606 |
# File 'zlib.c', line 2604 static VALUE rb_gzfile_sync(obj) VALUE obj; |
#sync=(flag) ⇒ Object
Same as IO. If flag is true, the associated IO object must respond to the flush method. While sync mode is true, the compression ratio decreases sharply.
2618 2619 2620 |
# File 'zlib.c', line 2618 static VALUE rb_gzfile_set_sync(obj, mode) VALUE obj, mode; |
#to_io ⇒ Object
Same as IO.
2374 2375 2376 |
# File 'zlib.c', line 2374 static VALUE rb_gzfile_to_io(obj) VALUE obj; |