Method: OpenC3::Structure#allocate_buffer_if_needed

Defined in:
lib/openc3/packets/structure.rb

#allocate_buffer_if_neededObject

Allocate a buffer if not available



161
162
163
164
165
166
167
# File 'lib/openc3/packets/structure.rb', line 161

def allocate_buffer_if_needed
  unless @buffer
    @buffer = ZERO_STRING * @defined_length
    @buffer.force_encoding(ASCII_8BIT_STRING)
  end
  return @buffer
end