Module: RCS::Serialization
- Defined in:
- lib/rcs-common/serializer.rb
Constant Summary collapse
- PREFIX_MASK =
0x00FFFFFF
Class Method Summary collapse
Class Method Details
.decode_prefix(str) ⇒ Object
22 23 24 25 |
# File 'lib/rcs-common/serializer.rb', line 22 def self.decode_prefix(str) prefix = str.unpack('L').shift return (prefix & ~PREFIX_MASK) >> 0x18, prefix & PREFIX_MASK end |
.prefix(type, size) ⇒ Object
18 19 20 |
# File 'lib/rcs-common/serializer.rb', line 18 def self.prefix(type, size) [(type << 0x18) | size].pack('L') end |