From 666a4338026866df1f18dd6b3f968c3788943e4c Mon Sep 17 00:00:00 2001 From: Yuichiro Hanada Date: Thu, 16 Aug 2012 18:40:14 +0900 Subject: add UserHistoryDictIOUtils. Change-Id: I8a70e43b23f65b5fd5f0ee0b30a94ad8f5ef8a8a --- .../inputmethod/latin/makedict/BinaryDictInputOutput.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java') diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java index 9f7f41331..bb7d1b2d2 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java +++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java @@ -189,7 +189,7 @@ public class BinaryDictInputOutput { // suspicion that a bug might be causing an infinite loop. private static final int MAX_PASSES = 24; - private interface FusionDictionaryBufferInterface { + public interface FusionDictionaryBufferInterface { public int readUnsignedByte(); public int readUnsignedShort(); public int readUnsignedInt24(); @@ -234,7 +234,6 @@ public class BinaryDictInputOutput { @Override public void position(int newPos) { mBuffer.position(newPos); - return; } } @@ -1393,7 +1392,6 @@ public class BinaryDictInputOutput { final FusionDictionaryBufferInterface buffer, final int headerSize, final Map words, final Map frequencies, final Map> bigrams) { - int[] pushedChars = new int[MAX_WORD_LENGTH + 1]; Stack stack = new Stack(); @@ -1443,8 +1441,6 @@ public class BinaryDictInputOutput { stack.push(childrenPos); } } - - return; } /** @@ -1462,7 +1458,6 @@ public class BinaryDictInputOutput { final Map words, final Map frequencies, final Map> bigrams) throws IOException, UnsupportedFormatException { - // Read header final int version = checkFormatVersion(buffer); final int optionsFlags = buffer.readUnsignedShort(); @@ -1507,10 +1502,8 @@ public class BinaryDictInputOutput { * @throws UnsupportedFormatException */ private static int readHeader(final FusionDictionaryBufferInterface buffer, - final HashMap options, - final int version) + final HashMap options, final int version) throws IOException, UnsupportedFormatException { - final int headerSize; if (version < FIRST_VERSION_WITH_HEADER_SIZE) { headerSize = buffer.position(); @@ -1523,7 +1516,6 @@ public class BinaryDictInputOutput { if (headerSize < 0) { throw new UnsupportedFormatException("header size can't be negative."); } - return headerSize; } @@ -1561,7 +1553,6 @@ public class BinaryDictInputOutput { public static FusionDictionary readDictionaryBinary( final FusionDictionaryBufferInterface buffer, final FusionDictionary dict) throws IOException, UnsupportedFormatException { - // clear cache wordCache.clear(); -- cgit v1.2.3-83-g751a