module ChunkyPNG::Chunk
def self.read(io)
-
(ChunkyPNG::Chung::Base)
- The loaded chunk instance.
Parameters:
-
io
(IO, #read
) -- The IO stream to read from.
def self.read(io) length, type = read_bytes(io, 8).unpack("Na4") content = read_bytes(io, length) crc = read_bytes(io, 4).unpack("N").first verify_crc!(type, content, crc) CHUNK_TYPES.fetch(type, Generic).read(type, content) end