class GifInfo::RawBlock

Abstract block which contains only datas in non-formatted form, so data which aren’t encoded in block form as usuall in GIF. Typicall example are color tables which site is known in forward.

@abstract

Public Class Methods

new(io, size) click to toggle source

Constructor.

@param [IO] io IO object @param [Integer] size amount of data for read

Calls superclass method GifInfo::Block::new
# File lib/gif-info/raw-block.rb, line 41
def initialize(io, size)
    @size = size
    super(io)
end

Public Instance Methods

body() click to toggle source

Returns data body. @return [String] raw data

# File lib/gif-info/raw-block.rb, line 51
def body
    if @body.nil?
        self.prepare!
        @body = @io.read(@size)
    end
    
    return @body
end
bytesize() click to toggle source

Returns block size. @return [Integer] block size in bytes

# File lib/gif-info/raw-block.rb, line 73
def bytesize
    self.body.bytesize
end
skip!() click to toggle source

Skips block in stream.

# File lib/gif-info/raw-block.rb, line 64
def skip!
    @io.seek(@size, IO::SEEK_CUR)
end