code: private int serializeUpdate(@NonNull TableEntry entry, byte[] target, int targetOffset, long version) {
          val key = entry.getKey().getKey();
          val value = entry.getValue();
          Preconditions.checkArgument(key.getLength() <= MAX_KEY_LENGTH, "Key too large.");
          int serializationLength = getUpdateLength(entry);
          Preconditions.checkArgument(serializationLength <= MAX_SERIALIZATION_LENGTH, "Key+Value serialization too large.");
          Preconditions.checkElementIndex(targetOffset + serializationLength - 1, target.length, "serialization does not fit in target buffer");
  
          // Serialize Header.
          targetOffset = writeHeader(target, targetOffset, key.getLength(), value.getLength(), version);
  
          // Key
          System.arraycopy(key.array(), key.arrayOffset(), target, targetOffset, key.getLength());
          targetOffset += key.getLength();
  
          // Value.
          System.arraycopy(value.array(), value.arrayOffset(), target, targetOffset, value.getLength());
          targetOffset += value.getLength();
  
          return targetOffset;
      }
docs: Serializes the given {@link TableEntry} to the given byte array.
  
  @param entry        The {@link TableEntry} to serialize.
  @param target       The byte array to serialize to.
  @param targetOffset The first offset within the byte array to serialize at.
  @param version      The version to serialize. This will be encoded in the {@link Header}.
  @return The first offset in the given byte array after the serialization.