code: public byte[] serialized() {
          final var nameBuffer = name.getBytes(StandardCharsets.UTF_8);
          final var typeLength = Integer.BYTES;
          final var nameLength = Integer.BYTES + nameBuffer.length;
          final var valueLength = type.fixedSize == VARIABLE_LENGTH ? Integer.BYTES + value.length : type.fixedSize;
          final var buffer = ByteBuffer.allocate(typeLength + nameLength + valueLength)
              .putInt(type.serialized)
              .putInt(nameBuffer.length);
          if (type.fixedSize == VARIABLE_LENGTH) {
              buffer.putInt(value.length);
          }
          buffer.put(nameBuffer).put(value);
          return buffer.array();
      }
docs: Convert a feature to byte array. The bytes will have the following structure
  
  <pre>
  [4-byte type][4-byte name length][4-byte value length][name][value]
  </pre>
  <p>
  or
  
  <pre>
  [4-byte type][4-byte name length][name][value]
  </pre>
  <p>
  if the length of the value can be determined from the type (some types have fixed length values).
  
  @return the byte array representation of the feature