Method: UR::Serialize::Message.unpack
- Defined in:
- lib/serialize.rb
.unpack ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/serialize.rb', line 33 def self.unpack msg_length = buf.unpack('C') msg = buf.unpack('x' + C * msg_length).pack('C*') src_length = buf.unpack('x' + 'x' * msg_length + 'C') src = buf.unpack('x' + 'x' * msg_length + 'x' + 'C' * src_length).pack('C*') lvl = buf.unpack('x' + 'x' * msg_length + 'x' + 'x' * src_length + 'C') Data.new(level,lvl,msg,src) end |