def split_and_add(string)
      # Duplicate the string as not to ruin the binary of the data element with our slicing:
      segment = string.dup
      append = segment.slice!(0, @max_size-@stream.length)
      # Clear out the stream along with a small part of the string:
      @segments << @stream.export + append
      if (30 + segment.length) > @max_size
        # The remaining part of the string is bigger than the max limit, fill up more segments:
        # How many full segments will this string fill?
        number = (segment.length/@max_size.to_f).floor
        start_index = 0
        number.times {
          @segments << segment.slice(start_index, @max_size)
          start_index += @max_size
        }
        # The remaining part is added to the stream:
        @stream.add_last(segment.slice(start_index, segment.length - start_index))
      else
        # The rest of the string is small enough that it can be added to the stream:
        @stream.add_last(segment)
      end
    end
def split_and_add(string)
      # Duplicate the string as not to ruin the binary of the data element with our slicing:
      segment = string.dup
      append = segment.slice!(0, @max_size-@stream.length)
      # Clear out the stream along with a small part of the string:
      @segments << @stream.export + append
      if (30 + segment.length) > @max_size
        # The remaining part of the string is bigger than the max limit, fill up more segments:
        # How many full segments will this string fill?
        number = (segment.length/@max_size.to_f).floor
        start_index = 0
        number.times {
          @segments << segment.slice(start_index, @max_size)
          start_index += @max_size
        }
        # The remaining part is added to the stream:
        @stream.add_last(segment.slice(start_index, segment.length - start_index))
      else
        # The rest of the string is small enough that it can be added to the stream:
        @stream.add_last(segment)
      end
    end
Splits a pre-encoded string in parts and adds it to the segments instance
 array.

 @param [String] string a pre-encoded string