diff options
author | 2012-10-11 16:08:25 +0900 | |
---|---|---|
committer | 2012-10-11 17:53:06 +0900 | |
commit | 66c90cd2ae49c49da8aeda5ab1d86bd9b76434c7 (patch) | |
tree | 1828bc63088749ed4e7fc7db0fa2cf3038427936 /java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java | |
parent | 471252b9da20f4b1d7f55fd15a34d3642a564fcb (diff) | |
download | latinime-66c90cd2ae49c49da8aeda5ab1d86bd9b76434c7.tar.gz latinime-66c90cd2ae49c49da8aeda5ab1d86bd9b76434c7.tar.xz latinime-66c90cd2ae49c49da8aeda5ab1d86bd9b76434c7.zip |
Put temporary files under a separate directory.
Bug: 7328003
Change-Id: Ibe5278ea209d149f87fd08785c77b17e3859948e
Diffstat (limited to '')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java index 46b363c10..b0b65edb6 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java @@ -46,7 +46,7 @@ public final class BinaryDictionaryFileDumper { /** * The size of the temporary buffer to copy files. */ - private static final int FILE_READ_BUFFER_SIZE = 1024; + private static final int FILE_READ_BUFFER_SIZE = 8192; // TODO: make the following data common with the native code private static final byte[] MAGIC_NUMBER_VERSION_1 = new byte[] { (byte)0x78, (byte)0xB1, (byte)0x00, (byte)0x00 }; @@ -149,7 +149,7 @@ public final class BinaryDictionaryFileDumper { final Uri.Builder wordListUriBuilder = getProviderUriBuilder(id); final String finalFileName = BinaryDictionaryGetter.getCacheFileName(id, locale, context); - final String tempFileName = finalFileName + ".tmp"; + final String tempFileName = BinaryDictionaryGetter.getTempFileName(id, context); for (int mode = MODE_MIN; mode <= MODE_MAX; ++mode) { InputStream originalSourceStream = null; @@ -287,6 +287,7 @@ public final class BinaryDictionaryFileDumper { * @param input the stream to be copied. * @param output an output stream to copy the data to. */ + // TODO: make output a BufferedOutputStream private static void checkMagicAndCopyFileTo(final BufferedInputStream input, final FileOutputStream output) throws FileNotFoundException, IOException { // Check the magic number |