ymodem
ymodem copied to clipboard
CRC issues
if (crc.calcCRC(block) != readCRC(crc)) { throw new InvalidBlockException(); }
I think it's something wrong about the algorithm , it always throw the InvalidBlockException. Could anybody fix it?
Hi,
Please, send to me content of block on wich you receive an error. I will check checksum
Use byte type definition the block,only represent 127 blocks,is there some mistakes? I can only transfer 127k
protected void sendDataBlocks(DataInputStream dataStream, byte blockNumber, CRC crc, byte[] block) throws IOException { int dataLength; while ((dataLength = dataStream.read(block)) != -1) { sendBlock(blockNumber++, block, dataLength, crc); } }
Use byte type instead of int type ,then solve the problem