presto-orc/src/main/java/io/prestosql/orc/stream/LongInputStreamV2.java/LongInputStreamV2/bytesToLongBE
class LongInputStreamV2:    private static long bytesToLongBE(InputStream input, int n)
            throws IOException
    {
        long out = 0;
        long val;
        while (n > 0) {
            n--;
            // store it in a long and then shift else integer overflow will occur
            val = input.read();
            out |= (val << (n * 8));
        }
        return out;
    }