private static void putValues(List<TSDataType> types, List<Object> values, ByteBuffer buffer)
      throws IoTDBConnectionException {
    for (int i = 0; i < values.size(); i++) {
      if (values.get(i) == null) {
        ReadWriteIOUtils.write(TYPE_NULL, buffer);
        continue;
      }
      ReadWriteIOUtils.write(types.get(i), buffer);
      switch (types.get(i)) {
        case BOOLEAN:
          ReadWriteIOUtils.write((Boolean) values.get(i), buffer);
          break;
        case INT32:
          ReadWriteIOUtils.write((Integer) values.get(i), buffer);
          break;
        case DATE:
          ReadWriteIOUtils.write(
              DateUtils.parseDateExpressionToInt((LocalDate) values.get(i)), buffer);
          break;
        case INT64:
        case TIMESTAMP:
          ReadWriteIOUtils.write((Long) values.get(i), buffer);
          break;
        case FLOAT:
          ReadWriteIOUtils.write((Float) values.get(i), buffer);
          break;
        case DOUBLE:
          ReadWriteIOUtils.write((Double) values.get(i), buffer);
          break;
        case TEXT:
        case STRING:
          byte[] bytes;
          if (values.get(i) instanceof Binary) {
            bytes = ((Binary) values.get(i)).getValues();
          } else {
            bytes = ((String) values.get(i)).getBytes(TSFileConfig.STRING_CHARSET);
          }
          ReadWriteIOUtils.write(bytes.length, buffer);
          buffer.put(bytes);
          break;
        case BLOB:
          bytes = ((Binary) values.get(i)).getValues();
          ReadWriteIOUtils.write(bytes.length, buffer);
          buffer.put(bytes);
          break;
        default:
          throw new IoTDBConnectionException(MSG_UNSUPPORTED_DATA_TYPE + types.get(i));
      }
    }
    buffer.flip();
  }
put value in buffer

@param types types list
@param values values list
@param buffer buffer to insert
@throws IoTDBConnectionException
iotdb-client/session/src/main/java/org/apache/iotdb/session/util/SessionUtils.java