Class | Archive::Zip::DataDescriptor |
In: |
lib/archive/zip/data_descriptor.rb
|
Parent: | Object |
Archive::Zip::DataDescriptor is a convenience class which bundles important information concerning the compressed data in a ZIP archive entry and allows easy comparisons between instances of itself.
compressed_size | [R] | A count of the number of bytes of compressed data associated with a set of uncompressed data. |
crc32 | [R] | A CRC32 checksum over some set of uncompressed data. |
uncompressed_size | [R] | A count of the number of bytes of a set of uncompressed data. |
Create a new instance of this class where crc32, compressed_size, and uncompressed_size are all integers representing a CRC32 checksum of uncompressed data, the size of compressed data, and the size of uncompressed data respectively.
Writes the data wrapped in this object to io which must be a writable, IO-like object providing a write method. Returns the number of bytes written.
Compares the crc32 and uncompressed_size attributes of this object with like-named attributes of other and raises Archive::Zip::Error for any mismatches.
NOTE: The compressed_size attribute is not checked because encrypted entries may have misleading compressed sizes. Checking only the CRC32 and uncompressed size of the data should be sufficient to ensure that an entry has been successfully extracted.