public static ZonedDateTime readDateTime64(InputStream input, byte[] buff, int scale, TimeZone tz) throws IOException {
        long value = readLongLE(input, buff);
        int nanoSeconds = 0;
        if (scale > 0) {
            int factor = BASES[scale];
            nanoSeconds = (int) (value % factor);
            value /= factor;
            if (nanoSeconds < 0) {
                nanoSeconds += factor;
                value--;
            }
            if (nanoSeconds > 0L) {
                nanoSeconds *= BASES[9 - scale];
            }
        }

        return Instant.ofEpochSecond(value, nanoSeconds).atZone(tz.toZoneId());
    }
Reads a datetime64 from input stream.

@param input - source of bytes
@param buff - for reading long value. Should be 8 bytes.
@param scale - scale of the datetime64
@param tz - timezone
@return
@throws IOException
client-v2/src/main/java/com/clickhouse/client/api/data_formats/internal/BinaryStreamReader.java