Perform a simple merge of two sets of metadata. This is a purely additive operation, because a single key can be associated with multiple values.
(Metadata other)
| 505 | * values. |
| 506 | */ |
| 507 | public void merge(Metadata other) { |
| 508 | if (other.isEmpty()) { |
| 509 | return; |
| 510 | } |
| 511 | int remaining = cap() - len(); |
| 512 | if (isEmpty() || remaining < other.len()) { |
| 513 | expand(len() + other.len()); |
| 514 | } |
| 515 | System.arraycopy(other.namesAndValues, 0, namesAndValues, len(), other.len()); |
| 516 | size += other.size; |
| 517 | } |
| 518 | |
| 519 | /** |
| 520 | * Merge values from the given set of keys into this set of metadata. If a key is present in keys, |