|
|
|
|
|
|
|
|
final InputStream stream = mContext.getResources().openRawResource(mRawResId); |
|
|
final InputStream stream = mContext.getResources().openRawResource(mRawResId); |
|
|
final ZipInputStream zipStream = new ZipInputStream(new BufferedInputStream(stream)); |
|
|
final ZipInputStream zipStream = new ZipInputStream(new BufferedInputStream(stream)); |
|
|
|
|
|
|
|
|
boolean successful = false; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
final byte[] buffer = new byte[10240]; |
|
|
final byte[] buffer = new byte[10240]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final File outputFile = new File(mOutput, "espeak-data/version"); |
|
|
final File outputFile = new File(mOutput, "espeak-data/version"); |
|
|
|
|
|
|
|
|
FileUtils.write(outputFile, version); |
|
|
FileUtils.write(outputFile, version); |
|
|
successful = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return RESULT_OK; |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
} finally { |
|
|
} finally { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isCancelled() || !successful) { |
|
|
|
|
|
return RESULT_CANCELED; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return RESULT_OK; |
|
|
|
|
|
|
|
|
return RESULT_CANCELED; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |