# File lib/em/protocols/postgres3.rb, line 38 def readbytes(n) str = read(n) if str == nil raise EOFError, "End of file reached" end if str.size < n raise IOError, "data truncated" end str end