presto-orc/src/main/java/io/prestosql/orc/stream/LongBitPacker.java/LongBitPacker/unpack1
class LongBitPacker:    private void unpack1(long[] buffer, int offset, int len, InputStream input)
            throws IOException
    {
        if (len != 0 && len < 8) {
            unpack1Unaligned(buffer, offset, len, input.read());
            return;
        }

        int blockReadableBytes = (len + 7) / 8;
        for (int i = 0; i < blockReadableBytes; ) {
            i += input.read(tmp, i, blockReadableBytes - i);
        }
        int outputIndex = offset;
        int end = offset + len;
        int tmpIndex = 0;
        for (; outputIndex + 7 < end; outputIndex += 8) {
            long value;
            value = tmp[tmpIndex];
            tmpIndex++;
            buffer[outputIndex] = (0b1000_0000 & value) >>> 7;
            buffer[outputIndex + 1] = (0b0100_0000 & value) >>> 6;
            buffer[outputIndex + 2] = (0b0010_0000 & value) >>> 5;
            buffer[outputIndex + 3] = (0b0001_0000 & value) >>> 4;
            buffer[outputIndex + 4] = (0b0000_1000 & value) >>> 3;
            buffer[outputIndex + 5] = (0b0000_0100 & value) >>> 2;
            buffer[outputIndex + 6] = (0b0000_0010 & value) >>> 1;
            buffer[outputIndex + 7] = 0b0000_0001 & value;
        }

        // Get the last byte and decode it, if necessary
        if (outputIndex < end) {
            unpack1Unaligned(buffer, outputIndex, end - outputIndex, tmp[blockReadableBytes - 1]);
        }
    }