From 890b44e5376413adc73025e046072bcce3e119c5 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Mon, 24 Feb 2014 22:17:27 +0900 Subject: Correctly read the header of APK-embedded dicts Bug: 13164518 Change-Id: I8768ad887af8b89ad9f29637f606c3c68629c7ca --- .../latin/makedict/BinaryDictDecoderEncoderTests.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 e21e340c2..0ee0fb577 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java @@ -251,7 +251,8 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase { FusionDictionary dict = null; try { - final DictDecoder dictDecoder = FormatSpec.getDictDecoder(file, bufferType); + final DictDecoder dictDecoder = FormatSpec.getDictDecoder(file, 0, file.length(), + bufferType); now = System.currentTimeMillis(); dict = dictDecoder.readDictionaryBinary(false /* deleteDictIfBroken */); diff = System.currentTimeMillis() - now; @@ -413,7 +414,8 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase { long now = -1, diff = -1; try { - final DictDecoder dictDecoder = FormatSpec.getDictDecoder(file, bufferType); + final DictDecoder dictDecoder = FormatSpec.getDictDecoder(file, 0, file.length(), + bufferType); now = System.currentTimeMillis(); dictDecoder.readUnigramsAndBigramsBinary(resultWords, resultFreqs, resultBigrams); diff = System.currentTimeMillis() - now; @@ -537,7 +539,8 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase { addBigrams(dict, words, bigrams); timeWritingDictToFile(file, dict, formatOptions); - final DictDecoder dictDecoder = FormatSpec.getDictDecoder(file, DictDecoder.USE_BYTEARRAY); + final DictDecoder dictDecoder = FormatSpec.getDictDecoder(file, 0, file.length(), + DictDecoder.USE_BYTEARRAY); try { dictDecoder.openDictBuffer(); } catch (IOException e) { -- cgit v1.2.3-83-g751a