diff options
author | 2013-09-17 18:20:03 +0900 | |
---|---|---|
committer | 2013-09-26 16:16:30 +0900 | |
commit | d188af70227ae7003fa410ccf4038a57825ae385 (patch) | |
tree | 237dacd6521dbf0880e9926f59f789ffc2981957 /java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java | |
parent | 4ec2c6cc5e57835e4d5a5a015d6365549cb55718 (diff) | |
download | latinime-d188af70227ae7003fa410ccf4038a57825ae385.tar.gz latinime-d188af70227ae7003fa410ccf4038a57825ae385.tar.xz latinime-d188af70227ae7003fa410ccf4038a57825ae385.zip |
Add SparseTable.
Bug: 10920165
Change-Id: I749dd0269e788799e30b10beb2671813d40ce15f
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java index 3b1d2427b..6cc0bfb76 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java +++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java @@ -225,6 +225,26 @@ public class BinaryDictEncoderUtils { return position; } + static void writeUIntToStream(final OutputStream stream, final int value, final int size) + throws IOException { + switch(size) { + case 4: + stream.write((value >> 24) & 0xFF); + /* fall through */ + case 3: + stream.write((value >> 16) & 0xFF); + /* fall through */ + case 2: + stream.write((value >> 8) & 0xFF); + /* fall through */ + case 1: + stream.write(value & 0xFF); + break; + default: + /* nop */ + } + } + // End utility methods // This method is responsible for finding a nice ordering of the nodes that favors run-time |