private void checkDecodedBlock(int i, byte[] data) { ClientCHK key = getKey(i); if(key == null) { Logger.error(this, "Key not found"); failOffThread(new FetchException(FetchExceptionMode.INTERNAL_ERROR, "Key not found")); return; } ClientCHKBlock block = encodeBlock(key, data); String decoded = i >= dataBlockCount ? "Encoded" : "Decoded"; if(block == null || !key.getNodeCHK().equals(block.getKey())) { Logger.error(this, decoded+" cross-segment block "+i+" failed!"); failOffThread(new FetchException(FetchExceptionMode.SPLITFILE_DECODE_ERROR, decoded+" cross-segment block does not match expected key")); return; } else { reportBlockToSegmentOffThread(i, key, block, data); } }