private static int getAsInt(ByteBuffer buf, int offset) {
        if (buf.isDirect()) {
            return HBasePlatformDependent.getInt(directBufferAddress(buf) + offset);
        }
        return HBasePlatformDependent.getInt(buf.array(),
                BYTE_ARRAY_BASE_OFFSET + buf.arrayOffset() + offset);
    }
Reads bytes at the given offset as an int value.

@return int value at offset
stroom-bytebuffer/src/main/java/stroom/bytebuffer/hbase/UnsafeAccess.java