lib/bindata/io.rb
# Reads exactly +n+ bytes from +io+.
#
# If the data read is nil an EOFError is raised.
#
# If the data read is too short an IOError is raised.
Reads exactly +n+ bytes from +io+.
If the data read is nil an EOFError is raised.

If the data read is too short an IOError is raised.
Reads exactly + n + bytes from + io + . If the data read is nil an EOFError is raised . If the data read is too short an IOError is raised .
def readbytes(n)
      reset_read_bits
      str = @raw_io.read(n)
      raise EOFError, "End of file reached" if str.nil?
      raise IOError, "data truncated" if str.size < n
      str
    end
def readbytes ( n ) reset_read_bits str = @raw_io . read ( n ) raise EOFError , "End of file reached" if str . nil? raise IOError , "data truncated" if str . size < n str end
Reads exactly +n+ bytes from +io+.
Reads exactly + n + bytes from + io + .
n
<not_specific>