Class IO
In: readbytes.rb
Parent: Object

Methods

readbytes  

Public Instance methods

[Source]

# File readbytes.rb, line 15
  def readbytes(n)
    str = read(n)
    if str == nil
      raise EOFError, "End of file reached"
    end
    if str.size < n
      raise TruncatedDataError.new("data truncated", str) 
    end
    str
  end

[Validate]