@Override
public String getBitsIdentificacaoAlgoritmo(WriterInterface writer) {
String firstByte = "00001111"; //identificaçãoAlgoritmo
String secondByte = StringUtils.integerToStringBinary(divisor, 8); // informação extra goloumb
if (writer instanceof WriterRedundancy) {
CRCService crcService = new CRCService();
String encodedCRC = crcService.calculateCRC8(firstByte, secondByte);
return firstByte + secondByte + encodedCRC;
}
return firstByte + secondByte;
}
1)Nessa parte do "if" o "writer" pode ser ou não do tipo "WriterRedundancy". Mas quando vai ser de um tipo ou do outro? Quando vai ser usado a redundancia e quando não vai ser usado?
2)Por que não usar a redundancia sempre?
Analize o projeot no github pra responder, vou mandar o link abaixo.