From a161bdac885fc8e5f0063d33b055b0a6ecdefbdb Mon Sep 17 00:00:00 2001 From: Yuichiro Hanada Date: Tue, 25 Sep 2012 17:52:31 +0900 Subject: [PATCH] add capacity to FusionDictionaryBufferInterface. bug: 6669677 Change-Id: I4627093811a19c46ce13fe351d1db63cbd78cf4a --- .../android/inputmethod/latin/UserHistoryDictIOUtils.java | 5 +++++ .../inputmethod/latin/makedict/BinaryDictInputOutput.java | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/UserHistoryDictIOUtils.java b/java/src/com/android/inputmethod/latin/UserHistoryDictIOUtils.java index 4a3d11aa1..05255a6b3 100644 --- a/java/src/com/android/inputmethod/latin/UserHistoryDictIOUtils.java +++ b/java/src/com/android/inputmethod/latin/UserHistoryDictIOUtils.java @@ -100,6 +100,11 @@ public class UserHistoryDictIOUtils { @Override public int limit() { + return mBuffer.length - 1; + } + + @Override + public int capacity() { return mBuffer.length; } } diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java index d4a4d7cda..f9339de08 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java +++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java @@ -63,6 +63,7 @@ public class BinaryDictInputOutput { public void position(int newPosition); public void put(final byte b); public int limit(); + public int capacity(); } public static final class ByteBufferWrapper implements FusionDictionaryBufferInterface { @@ -112,6 +113,11 @@ public class BinaryDictInputOutput { public int limit() { return mBuffer.limit(); } + + @Override + public int capacity() { + return mBuffer.capacity(); + } } /**