private void writeLine(byte[] data){
  int checksum=0;
  try {
    buffOut.write(':');
    for (int i=0; i < data.length; i++) {
      writeHexByte(data[i]);
      checksum+=data[i];
    }
    checksum=checksum & 0xff;
    if (checksum > 0) {
      checksum=256 - checksum;
    }
    writeHexByte((byte)checksum);
    buffOut.write('\n');
  }
 catch (  IOException e) {
  }
}

private void writeLine ( byte [ ] data ) { int checksum = 0 ; try { buffOut . write ( ':' ) ; for ( int i = 0 ; i < data . length ; i ++ ) { writeHexByte ( data [ i ] ) ; checksum += data [ i ] ; } checksum = checksum & 0xff ; if ( checksum > 0 ) { checksum = 256 - checksum ; } writeHexByte ( ( byte ) checksum ) ; buffOut . write ( '\n' ) ; } catch ( IOException e ) { } }
write a byte array to the hex file , prepending " : " and appending checksum and carriage return
