Class: Zlib::GzipFile

Inherits:
Object
  • Object
show all
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

GzipReader, GzipWriter

Defined Under Namespace

Classes: CRCError, Error, LengthError, NoFooter

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.wrapObject

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

#closeObject

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.

Returns:

  • (Boolean)


2581
2582
2583
# File 'zlib.c', line 2581

static VALUE
rb_gzfile_closed_p(obj)
VALUE obj;

#commentObject

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;

#crcObject

Returns CRC value of the uncompressed data.



2384
2385
2386
# File 'zlib.c', line 2384

static VALUE
rb_gzfile_crc(obj)
VALUE obj;

#finishObject

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;

#levelObject

Returns compression level.



2404
2405
2406
# File 'zlib.c', line 2404

static VALUE
rb_gzfile_level(obj)
VALUE obj;

#mtimeObject

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_nameObject

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_codeObject

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;

#syncObject

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_ioObject

Same as IO.



2374
2375
2376
# File 'zlib.c', line 2374

static VALUE
rb_gzfile_to_io(obj)
VALUE obj;