class ChunkyPNG::Chunk::Base

def initialize(type, attributes = {})

def initialize(type, attributes = {})
  self.type = type
  attributes.each { |k, v| send("#{k}=", v) }
end

def write(io)

def write(io)
  write_with_crc(io, content || '')
end

def write_with_crc(io, content)

def write_with_crc(io, content)
  io << [content.length].pack('N') << type << content
  io << [Zlib.crc32(content, Zlib.crc32(type))].pack('N')
end