class ChunkyPNG::Datastream

def verify_signature!(io)

Raises:
  • (RuntimeError) - An exception is raised if the PNG signature is not found at

Parameters:
  • io (IO) -- The stream to read the PNG signature from.
def verify_signature!(io)
  signature = io.read(ChunkyPNG::Datastream::SIGNATURE.length)
  unless signature == ChunkyPNG::Datastream::SIGNATURE
    raise ChunkyPNG::SignatureMismatch, "PNG signature not found!"
  end
end