aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorYuichiro Hanada <yhanada@google.com>2012-09-14 12:07:39 +0900
committerYuichiro Hanada <yhanada@google.com>2012-09-18 14:42:52 +0900
commit8adc0154e6a1412e8b2a7ba5b2a67650062e0dbf (patch)
tree1f65ae016ccbb7cfc9d3ee02271b274fabeb89be /java/src
parent65e4970026fd0e7964796c0e252b6d71632b634c (diff)
downloadlatinime-8adc0154e6a1412e8b2a7ba5b2a67650062e0dbf.tar.gz
latinime-8adc0154e6a1412e8b2a7ba5b2a67650062e0dbf.tar.xz
latinime-8adc0154e6a1412e8b2a7ba5b2a67650062e0dbf.zip
Remove populateOptions(final ByteBuffer buffer).
Change-Id: Ifc4c64c9cffe4f343c5a604c192db010a1792acc
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java12
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java5
2 files changed, 6 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
index 487315c0e..9764df072 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
@@ -29,7 +29,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.BufferUnderflowException;
-import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.HashMap;
@@ -358,14 +357,15 @@ class BinaryDictionaryGetter {
try {
// Read the version of the file
inStream = new FileInputStream(f);
- final ByteBuffer buffer = inStream.getChannel().map(
- FileChannel.MapMode.READ_ONLY, 0, f.length());
- final int magic = buffer.getInt();
+ final BinaryDictInputOutput.ByteBufferWrapper buffer =
+ new BinaryDictInputOutput.ByteBufferWrapper(inStream.getChannel().map(
+ FileChannel.MapMode.READ_ONLY, 0, f.length()));
+ final int magic = buffer.readInt();
if (magic != FormatSpec.VERSION_2_MAGIC_NUMBER) {
return false;
}
- final int formatVersion = buffer.getInt();
- final int headerSize = buffer.getInt();
+ final int formatVersion = buffer.readInt();
+ final int headerSize = buffer.readInt();
final HashMap<String, String> options = CollectionUtils.newHashMap();
BinaryDictInputOutput.populateOptions(buffer, headerSize, options);
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
index 6f508695e..68d8bc553 100644
--- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
+++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
@@ -1543,11 +1543,6 @@ public class BinaryDictInputOutput {
options.put(key, value);
}
}
- // TODO: remove this method.
- public static void populateOptions(final ByteBuffer buffer, final int headerSize,
- final HashMap<String, String> options) {
- populateOptions(new ByteBufferWrapper(buffer), headerSize, options);
- }
/**
* Reads a buffer and returns the memory representation of the dictionary.