Method: OpenC3::Structure#resize_buffer

Defined in:
lib/openc3/packets/structure.rb,
ext/openc3/ext/structure/structure.c

#resize_bufferObject

Resize the buffer at least the defined length of the structure



123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/openc3/packets/structure.rb', line 123

def resize_buffer
  if @buffer
    # Extend data size
    if @buffer.length < @defined_length
      @buffer << (ZERO_STRING * (@defined_length - @buffer.length))
    end
  else
    allocate_buffer_if_needed()
  end

  return self
end