Class: StringIO Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/em/protocols/postgres3.rb |
Instance Method Summary
-
#read_exactly_n_bytes(n)
Alias for #readbytes.
-
#readbytes(n)
(also: #read_exactly_n_bytes)
Internal use only
Reads exactly
n
bytes.
Instance Method Details
#read_exactly_n_bytes(n)
Alias for #readbytes.
# File 'lib/em/protocols/postgres3.rb', line 48
alias read_exactly_n_bytes readbytes
#readbytes(n) Also known as: #read_exactly_n_bytes
Reads exactly n
bytes.
If the data read is nil an EOFError is raised.
If the data read is too short an IOError is raised
# 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