public static byte[] getChmBlockSegment(byte[] data, ChmLzxcResetTable resetTable,
                                            int blockNumber, int lzxcBlockOffset,
                                            int lzxcBlockLength) throws TikaException {
        ChmAssert.assertChmBlockSegment(data, resetTable, blockNumber, lzxcBlockOffset,
                lzxcBlockLength);
        int blockLength = -1;
        // TODO add int_max_value checking
        if (blockNumber < (resetTable.getBlockAddress().length - 1)) {
            blockLength = (int) (resetTable.getBlockAddress()[blockNumber + 1] -
                    resetTable.getBlockAddress()[blockNumber]);
        } else {
            /* new code */
            if (blockNumber >= resetTable.getBlockAddress().length) {
                blockLength = 0;
            } else
                /* end new code */ {
                blockLength = (int) (lzxcBlockLength - resetTable.getBlockAddress()[blockNumber]);
            }
        }
        byte[] t = ChmCommons.copyOfRange(data,
                (int) (lzxcBlockOffset + resetTable.getBlockAddress()[blockNumber]),
                (int) (lzxcBlockOffset + resetTable.getBlockAddress()[blockNumber] + blockLength));
        return (t != null) ? t : new byte[1];
    }
LZX supports window sizes of 2^15 (32Kb) through 2^21 (2Mb) Returns X,
i.e 2^X

@param window chmLzxControlData.getWindowSize()
@return window size
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/chm/ChmCommons.java