160
161
162
163
164
165
166
167
168
169
170
171
|
# File 'lib/protobuf/field/base_field_object_definitions.rb', line 160
def call(message_instance, bytes)
array = message_instance[@name]
stream = ::StringIO.new(bytes)
if @wire_type == ::Protobuf::WireType::VARINT
array << @selph.decode(Varint.decode(stream)) until stream.eof?
elsif @wire_type == ::Protobuf::WireType::FIXED64
array << @selph.decode(stream.read(8)) until stream.eof?
elsif @wire_type == ::Protobuf::WireType::FIXED32
array << @selph.decode(stream.read(4)) until stream.eof?
end
end
|