public static void writeDateTime(OutputStream output, LocalDateTime value, int scale, TimeZone tz)
            throws IOException {
        if (ClickHouseChecker.between(scale, ClickHouseValues.PARAM_SCALE, 0,
                ClickHouseDataType.DateTime64.getMaxScale()) == 0) {
            writeDateTime32(output, value, tz);
        } else {
            writeDateTime64(output, value, scale, tz);
        }
    }
Write a {@link java.time.LocalDateTime} to given output stream.

@param output non-null output stream
@param value  local datetime
@param scale  scale of the datetime, must between 0 and 9 inclusive
@param tz     time zone, null is treated as UTC
@throws IOException when failed to write value to output stream or reached
                    end of the stream
clickhouse-data/src/main/java/com/clickhouse/data/format/BinaryStreamUtils.java