class FormatParser::EXIFParser::IOExt

EXIFR kindly requests the presence of a few more methods than what our IOConstraint is willing to provide, but they can be derived from the available ones

Public Instance Methods

getbyte()
Alias for: readbyte
readbyte() click to toggle source
# File lib/parsers/exif_parser.rb, line 20
def readbyte
  if byte = read(1)
    byte.unpack('C').first
  end
end
Also aliased as: getbyte
seek(n, seek_mode = IO::SEEK_SET) click to toggle source
# File lib/parsers/exif_parser.rb, line 26
def seek(n, seek_mode = IO::SEEK_SET)
  io = __getobj__
  case seek_mode
  when IO::SEEK_SET
    io.seek(n)
  when IO::SEEK_CUR
    io.seek(io.pos + n)
  when IO::SEEK_END
    io.seek(io.size + n)
  else
    raise Errno::EINVAL
  end
end