protected void writeInitData(final BluetoothGattCharacteristic characteristic,final CRC32 crc32) throws DfuException, DeviceDisconnectedException, UploadAbortedException {
  try {
    byte[] data=new byte[20];
    int size;
    while ((size=mInitPacketStream.read(data,0,data.length)) != -1) {
      writeInitPacket(characteristic,data,size);
      if (crc32 != null)       crc32.update(data,0,size);
    }
  }
 catch (  final IOException e) {
    loge("Error while reading Init packet file",e);
    throw new DfuException("Error while reading Init packet file",DfuBaseService.ERROR_FILE_ERROR);
  }
}

protected void writeInitData ( final BluetoothGattCharacteristic characteristic , final CRC32 crc32 ) throws DfuException , DeviceDisconnectedException , UploadAbortedException { try { byte [ ] data = new byte [ 20 ] ; int size ; while ( ( size = mInitPacketStream . read ( data , 0 , data . length ) ) != - 1 ) { writeInitPacket ( characteristic , data , size ) ; if ( crc32 != null ) crc32 . update ( data , 0 , size ) ; } } catch ( final IOException e ) { loge ( "Error while reading Init packet file" , e ) ; throw new DfuException ( "Error while reading Init packet file" , DfuBaseService . ERROR_FILE_ERROR ) ; } }
wends the whole init packet stream to the given characteristic .
