aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
diff options
context:
space:
mode:
authorYuichiro Hanada <yhanada@google.com>2013-08-14 12:03:06 +0900
committerYuichiro Hanada <yhanada@google.com>2013-08-19 11:15:03 +0900
commitd794b42f983a4f9563ef0334ed0b8f9cb44e084d (patch)
tree837202638f5bf16934b68daf907e49752e334c4b /tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
parent606a056b530c566f3397b8083f83288fe255bff8 (diff)
downloadlatinime-d794b42f983a4f9563ef0334ed0b8f9cb44e084d.tar.gz
latinime-d794b42f983a4f9563ef0334ed0b8f9cb44e084d.tar.xz
latinime-d794b42f983a4f9563ef0334ed0b8f9cb44e084d.zip
Add HeaderReaderInterface.
Change-Id: I298f86b70d18cd08b240509b6f757c72e1a59ffe
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
index e98790b65..c0972e125 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
@@ -493,21 +493,21 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
}
// Tests for getTerminalPosition
- private String getWordFromBinary(final BinaryDictReader reader, final int address) {
- final FusionDictionaryBufferInterface buffer = reader.getBuffer();
+ private String getWordFromBinary(final BinaryDictReader dictReader, final int address) {
+ final FusionDictionaryBufferInterface buffer = dictReader.getBuffer();
if (buffer.position() != 0) buffer.position(0);
- FileHeader header = null;
+ FileHeader fileHeader = null;
try {
- header = BinaryDictDecoder.readHeader(buffer);
+ fileHeader = BinaryDictDecoder.readHeader(dictReader);
} catch (IOException e) {
return null;
} catch (UnsupportedFormatException e) {
return null;
}
- if (header == null) return null;
- return BinaryDictDecoder.getWordAtAddress(buffer, header.mHeaderSize,
- address - header.mHeaderSize, header.mFormatOptions).mWord;
+ if (fileHeader == null) return null;
+ return BinaryDictDecoder.getWordAtAddress(buffer, fileHeader.mHeaderSize,
+ address - fileHeader.mHeaderSize, fileHeader.mFormatOptions).mWord;
}
private long runGetTerminalPosition(final BinaryDictReader reader, final String word, int index,