Class: ChunkyPNG::Chunk::End

### Home Classes Methods

### In Files

- lib/chunky_png/chunk.rb

### Parent

ChunkyPNG::Chunk::Base

### Methods

- ::new
- ::read
- #content

### Files

- BENCHMARKING.rdoc
- CHANGELOG.rdoc
- CONTRIBUTING.rdoc
- README.rdoc

### Class/Module Index

Quicksearch

- ChunkyPNG
- ChunkyPNG::CRCMismatch
- ChunkyPNG::Canvas
- ChunkyPNG::Canvas::Adam7Interlacing
- ChunkyPNG::Canvas::DataUrlExporting
- ChunkyPNG::Canvas::DataUrlImporting
- ChunkyPNG::Canvas::Drawing
- ChunkyPNG::Canvas::Masking
- ChunkyPNG::Canvas::Operations
- ChunkyPNG::Canvas::PNGDecoding
- ChunkyPNG::Canvas::PNGEncoding
- ChunkyPNG::Canvas::Resampling
- ChunkyPNG::Canvas::StreamExporting
- ChunkyPNG::Canvas::StreamImporting
- ChunkyPNG::Chunk
- ChunkyPNG::Chunk::Base
- ChunkyPNG::Chunk::CompressedText
- ChunkyPNG::Chunk::End
- ChunkyPNG::Chunk::Generic
- ChunkyPNG::Chunk::Header
- ChunkyPNG::Chunk::ImageData
- ChunkyPNG::Chunk::InternationalText
- ChunkyPNG::Chunk::Palette
- ChunkyPNG::Chunk::Text
- ChunkyPNG::Chunk::Transparency
- ChunkyPNG::Color
- ChunkyPNG::Datastream
- ChunkyPNG::Dimension
- ChunkyPNG::Exception
- ChunkyPNG::ExpectationFailed
- ChunkyPNG::Image
- ChunkyPNG::NotSupported
- ChunkyPNG::OutOfBounds
- ChunkyPNG::Palette
- ChunkyPNG::Point
- ChunkyPNG::RMagick
- ChunkyPNG::SignatureMismatch
- ChunkyPNG::Vector
- Enumerable
- String

No matching classes.

# ChunkyPNG::Chunk::End

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

### Public Class Methods

new() click to toggle source

    # File lib/chunky_png/chunk.rb, line 163
    def initialize
      super('IEND')
    end

read(type, content) click to toggle source

Reads the END chunk. It will check if the content is empty. @param type [String] The four character chunk type indicator (=

    "IEND").

@param content [String] 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.

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

### Public Instance Methods

content() click to toggle source

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

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.