aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
diff options
context:
space:
mode:
authorYuichiro Hanada <yhanada@google.com>2012-09-18 00:10:51 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-09-18 00:10:51 -0700
commitefb38a23146a0e7525c371968fa326996e17fff9 (patch)
tree1f65ae016ccbb7cfc9d3ee02271b274fabeb89be /java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
parent902fbd9f12a2c1889671b64e730108c753a23b75 (diff)
parent4ca7275bd754cc483bb77d0f780dc59d27c70bf4 (diff)
downloadlatinime-efb38a23146a0e7525c371968fa326996e17fff9.tar.gz
latinime-efb38a23146a0e7525c371968fa326996e17fff9.tar.xz
latinime-efb38a23146a0e7525c371968fa326996e17fff9.zip
am 4ca7275b: am 8adc0154: Remove populateOptions(final ByteBuffer buffer).
* commit '4ca7275bd754cc483bb77d0f780dc59d27c70bf4': Remove populateOptions(final ByteBuffer buffer).
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java')
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java12
1 files changed, 6 insertions, 6 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);