I incorporated Fletcher16 into it to create the reliable data transfer. I have reliableWrite in the Java program which add * followed by the fletcher16 checksum. In Arduino, this is then split off, and the checksum is calculated again. If the 2 match, the checksum is sent back as a unique ok, otherwise it sends "5" just to make something go back. If the returned checksum does not match, Java writes again.