class XDR::RPC::RecordReader
Constants
- LAST_MASK
- LENGTH_MASK
Public Instance Methods
read(io)
click to toggle source
# File lib/xdr/rpc/record_reader.rb, line 7 def read(io) header = read_bytes(io, 4).unpack("L>").first length = header & LENGTH_MASK last = (header & LAST_MASK) > 0 raw_content = read_bytes(io, length) content = StringIO.new(raw_content) XDR::RPC::Record.new(last, length, content) end