Class ChunkyPNG::Chunk::End
In: lib/chunky_png/chunk.rb
Parent: Base

The End (IEND) chunk indicates the last chunk of a PNG stream. It does not contain any data.

Methods

content   new   read  

Public Class methods

[Source]

     # File lib/chunky_png/chunk.rb, line 151
151:       def initialize
152:         super('IEND')
153:       end

Reads the END chunk. It will check if the content is empty. @param [String] type The four character chunk type indicator (= "IEND"). @param [String] content The content read from the chunk. Should be empty. @return [ChunkyPNG::Chunk::End] The new End chunk instance. @raise [RuntimeError] Raises an exception if the content was not empty.

[Source]

     # File lib/chunky_png/chunk.rb, line 160
160:       def self.read(type, content)
161:         raise ExpectationFailed, 'The IEND chunk should be empty!' if content.bytesize > 0
162:         self.new
163:       end

Public Instance methods

Returns an empty string, because this chunk should always be empty. @return [""] An empty string.

[Source]

     # File lib/chunky_png/chunk.rb, line 167
167:       def content
168:         ChunkyPNG::Datastream.empty_bytearray
169:       end

[Validate]