private void endBlock() { this.computedBlockCRC = this.crc.getFinalCRC(); // A bad CRC is considered a fatal error. if (this.storedBlockCRC != this.computedBlockCRC) { // make next blocks readable without error // (repair feature, not yet documented, not tested) this.computedCombinedCRC = (this.storedCombinedCRC << 1) | (this.storedCombinedCRC >>> 31); this.computedCombinedCRC ^= this.storedBlockCRC; reportCRCError(); } this.computedCombinedCRC = (this.computedCombinedCRC << 1) | (this.computedCombinedCRC >>> 31); this.computedCombinedCRC ^= this.computedBlockCRC; }
public CRC() { initialiseCRC(); }
private void setupRandPartC() throws IOException { if (this.suJ2 < this.suZ) { this.currentChar = this.suCh2; this.crc.updateCRC(this.suCh2); this.suJ2++; } else { this.currentState = RAND_PART_A_STATE; this.suI2++; this.suCount = 0; setupRandPartA(); } }
private void setupRandPartC() throws IOException { if (this.suJ2 < this.suZ) { this.currentChar = this.suCh2; this.crc.updateCRC(this.suCh2); this.suJ2++; } else { this.currentState = RAND_PART_A_STATE; this.suI2++; this.suCount = 0; setupRandPartA(); } }
public CRC() { initialiseCRC(); }
private void endBlock() { this.computedBlockCRC = this.crc.getFinalCRC(); // A bad CRC is considered a fatal error. if (this.storedBlockCRC != this.computedBlockCRC) { // make next blocks readable without error // (repair feature, not yet documented, not tested) this.computedCombinedCRC = (this.storedCombinedCRC << 1) | (this.storedCombinedCRC >>> 31); this.computedCombinedCRC ^= this.storedBlockCRC; reportCRCError(); } this.computedCombinedCRC = (this.computedCombinedCRC << 1) | (this.computedCombinedCRC >>> 31); this.computedCombinedCRC ^= this.computedBlockCRC; }
private void setupNoRandPartC() throws IOException { if (this.suJ2 < this.suZ) { int suCh2Shadow = this.suCh2; this.currentChar = suCh2Shadow; this.crc.updateCRC(suCh2Shadow); this.suJ2++; this.currentState = NO_RAND_PART_C_STATE; } else { this.suI2++; this.suCount = 0; setupNoRandPartA(); } }
this.crc.initialiseCRC(); this.currentState = START_BLOCK_STATE;
private void setupNoRandPartC() throws IOException { if (this.suJ2 < this.suZ) { int suCh2Shadow = this.suCh2; this.currentChar = suCh2Shadow; this.crc.updateCRC(suCh2Shadow); this.suJ2++; this.currentState = NO_RAND_PART_C_STATE; } else { this.suI2++; this.suCount = 0; setupNoRandPartA(); } }
this.crc.initialiseCRC(); this.currentState = START_BLOCK_STATE;
private void setupNoRandPartA() throws IOException { if (this.suI2 <= this.last) { this.suChPrev = this.suCh2; int suCh2Shadow = this.data.ll8[this.suTPos] & 0xff; this.suCh2 = suCh2Shadow; this.suTPos = this.data.tt[this.suTPos]; this.suI2++; this.currentChar = suCh2Shadow; this.currentState = NO_RAND_PART_B_STATE; this.crc.updateCRC(suCh2Shadow); } else { this.currentState = NO_RAND_PART_A_STATE; endBlock(); initBlock(); setupBlock(); } }
private void setupNoRandPartA() throws IOException { if (this.suI2 <= this.last) { this.suChPrev = this.suCh2; int suCh2Shadow = this.data.ll8[this.suTPos] & 0xff; this.suCh2 = suCh2Shadow; this.suTPos = this.data.tt[this.suTPos]; this.suI2++; this.currentChar = suCh2Shadow; this.currentState = NO_RAND_PART_B_STATE; this.crc.updateCRC(suCh2Shadow); } else { this.currentState = NO_RAND_PART_A_STATE; endBlock(); initBlock(); setupBlock(); } }
private void setupRandPartA() throws IOException { if (this.suI2 <= this.last) { this.suChPrev = this.suCh2; int suCh2Shadow = this.data.ll8[this.suTPos] & 0xff; this.suTPos = this.data.tt[this.suTPos]; if (this.suRNToGo == 0) { this.suRNToGo = R_NUMS[this.suRTPos] - 1; if (++this.suRTPos == 512) this.suRTPos = 0; } else this.suRNToGo--; this.suCh2 = suCh2Shadow ^= (this.suRNToGo == 1) ? 1 : 0; this.suI2++; this.currentChar = suCh2Shadow; this.currentState = RAND_PART_B_STATE; this.crc.updateCRC(suCh2Shadow); } else { endBlock(); initBlock(); setupBlock(); } }
private void setupRandPartA() throws IOException { if (this.suI2 <= this.last) { this.suChPrev = this.suCh2; int suCh2Shadow = this.data.ll8[this.suTPos] & 0xff; this.suTPos = this.data.tt[this.suTPos]; if (this.suRNToGo == 0) { this.suRNToGo = R_NUMS[this.suRTPos] - 1; if (++this.suRTPos == 512) this.suRTPos = 0; } else this.suRNToGo--; this.suCh2 = suCh2Shadow ^= (this.suRNToGo == 1) ? 1 : 0; this.suI2++; this.currentChar = suCh2Shadow; this.currentState = RAND_PART_B_STATE; this.crc.updateCRC(suCh2Shadow); } else { endBlock(); initBlock(); setupBlock(); } }