class Ronin::Support::Archive::Zip::Reader::Entry

Represents an entry in a zip archive.

@since 1.0.0

Attributes

compression[R]

The compression ratio of the file.

@return [Integer]

crc32[R]

The CRC32 checksum (in hex encoding).

@return [String]

date[R]

The date of the file.

@return [Date]

length[R]

The length of the file.

@return [Integer]

method[R]

The compression method used.

@return [:stored, :deflate]

name[R]

The name of the file.

@return [String]

size[R]

The size of the file.

@return [Integer]

time[R]

The time of the file.

@return [Time]

Public Class Methods

new(reader, length: , method: , size: , compression: , date: , time: , crc32: , name: ) click to toggle source

Initializes the zip archive entry.

@param [Reader] reader

@param [Integer] length

@param [:stored, :deflate] method

@param [Integer] size

@param [Integer] compression

@param [Date] date

@param [Time] time

@param [String] crc32

@param [String] name

@api private

# File lib/ronin/support/archive/zip/reader/entry.rb, line 97
def initialize(reader, length: ,
                       method: ,
                       size:   ,
                       compression: ,
                       date: ,
                       time: ,
                       crc32: ,
                       name: )
  @reader      = reader
  @length      = length
  @method      = method
  @size        = size
  @compression = compression
  @date        = date
  @time        = time
  @crc32       = crc32
  @name        = name
end

Public Instance Methods

read(length=nil) click to toggle source

Reads the contents of the entry.

@param [Integer, nil] length

Optional number of bytes to read.

@return [String]

The read data.
# File lib/ronin/support/archive/zip/reader/entry.rb, line 125
def read(length=nil)
  @reader.read(@name, length: length)
end