Method: Zip::CentralDirectory#read_e_o_c_d

Defined in:
lib/zip/central_directory.rb

#read_e_o_c_d(io) ⇒ Object

:nodoc:

Raises:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/zip/central_directory.rb', line 54

def read_e_o_c_d(io) #:nodoc:
  buf                                   = get_e_o_c_d(io)
  @numberOfThisDisk                     = Entry.read_zip_short(buf)
  @numberOfDiskWithStartOfCDir          = Entry.read_zip_short(buf)
  @totalNumberOfEntriesInCDirOnThisDisk = Entry.read_zip_short(buf)
  @size                                 = Entry.read_zip_short(buf)
  @sizeInBytes                          = Entry.read_zip_long(buf)
  @cdirOffset                           = Entry.read_zip_long(buf)
  commentLength                         = Entry.read_zip_short(buf)
  if commentLength <= 0
    @comment = buf.slice!(0, buf.size)
  else
    @comment = buf.read(commentLength)
  end
  raise ZipError, "Zip consistency problem while reading eocd structure" unless buf.size == 0
end