Class: Protopuffs::LengthDelimited

Inherits:
MessageField show all
Defined in:
lib/protopuffs/message/field.rb

Direct Known Subclasses

Bytes, Embedded, String

Instance Attribute Summary

Attributes inherited from MessageField

#default, #identifier, #tag

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MessageField

factory, #key, #optional?, #repeated?, shift_tag, #to_wire_format_with_value

Class Method Details

.shift(buffer) ⇒ Object



173
174
175
176
177
# File 'lib/protopuffs/message/field.rb', line 173

def self.shift(buffer)
  bytes = VarInt.shift(buffer)
  value_length = VarInt.decode(bytes)
  buffer.read(value_length)
end

.wire_typeObject



172
# File 'lib/protopuffs/message/field.rb', line 172

def self.wire_type; WireType::LENGTH_DELIMITED end

Instance Method Details

#decode(bytes) ⇒ Object



178
# File 'lib/protopuffs/message/field.rb', line 178

def decode(bytes); bytes end