From c922c8a504ab31aae26193f1bf319bf9f91406a5 Mon Sep 17 00:00:00 2001 From: Yuichiro Hanada Date: Tue, 20 Aug 2013 21:35:21 +0900 Subject: Add DictEncoder. Change-Id: I41049b9118b58838e5dedf8e5618d939ca70c5ef --- .../inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java') diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java index f30be97f3..83ccdec59 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java @@ -32,7 +32,6 @@ import com.android.inputmethod.latin.utils.CollectionUtils; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -204,17 +203,14 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase { long now = -1, diff = -1; try { - final FileOutputStream out = new FileOutputStream(file); + final DictEncoder dictEncoder = new Ver3DictEncoder(file); now = System.currentTimeMillis(); // If you need to dump the dict to a textual file, uncomment the line below and the // function above // dumpToCombinedFileForDebug(file, "/tmp/foo"); - BinaryDictEncoderUtils.writeDictionaryBinary(out, dict, formatOptions); + dictEncoder.writeDictionary(dict, formatOptions); diff = System.currentTimeMillis() - now; - - out.flush(); - out.close(); } catch (IOException e) { Log.e(TAG, "IO exception while writing file", e); } catch (UnsupportedFormatException e) { -- cgit v1.2.3-83-g751a