Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
19b247e7
Commit
19b247e7
authored
11 years ago
by
Yuichiro Hanada
Browse files
Options
Downloads
Patches
Plain Diff
Fix the name of the argument of writeString.
Change-Id: I76916914f1402913daa56dd5387fe82e42287989
parent
7e7fe605
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
+8
-9
8 additions, 9 deletions
...id/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
with
8 additions
and
9 deletions
java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
+
8
−
9
View file @
19b247e7
...
@@ -208,8 +208,7 @@ public final class BinaryDictDecoderUtils {
...
@@ -208,8 +208,7 @@ public final class BinaryDictDecoderUtils {
* @param word the string to write.
* @param word the string to write.
* @return the size written, in bytes.
* @return the size written, in bytes.
*/
*/
static
int
writeString
(
final
byte
[]
buffer
,
final
int
origin
,
static
int
writeString
(
final
byte
[]
buffer
,
final
int
origin
,
final
String
word
)
{
final
String
word
)
{
final
int
length
=
word
.
length
();
final
int
length
=
word
.
length
();
int
index
=
origin
;
int
index
=
origin
;
for
(
int
i
=
0
;
i
<
length
;
i
=
word
.
offsetByCodePoints
(
i
,
1
))
{
for
(
int
i
=
0
;
i
<
length
;
i
=
word
.
offsetByCodePoints
(
i
,
1
))
{
...
@@ -231,26 +230,26 @@ public final class BinaryDictDecoderUtils {
...
@@ -231,26 +230,26 @@ public final class BinaryDictDecoderUtils {
*
*
* This will also write the terminator byte.
* This will also write the terminator byte.
*
*
* @param
buffer
the OutputStream to write to.
* @param
stream
the OutputStream to write to.
* @param word the string to write.
* @param word the string to write.
* @return the size written, in bytes.
* @return the size written, in bytes.
*/
*/
static
int
writeString
(
final
OutputStream
buffer
,
final
String
word
)
throws
IOException
{
static
int
writeString
(
final
OutputStream
stream
,
final
String
word
)
throws
IOException
{
final
int
length
=
word
.
length
();
final
int
length
=
word
.
length
();
int
written
=
0
;
int
written
=
0
;
for
(
int
i
=
0
;
i
<
length
;
i
=
word
.
offsetByCodePoints
(
i
,
1
))
{
for
(
int
i
=
0
;
i
<
length
;
i
=
word
.
offsetByCodePoints
(
i
,
1
))
{
final
int
codePoint
=
word
.
codePointAt
(
i
);
final
int
codePoint
=
word
.
codePointAt
(
i
);
final
int
charSize
=
getCharSize
(
codePoint
);
final
int
charSize
=
getCharSize
(
codePoint
);
if
(
1
==
charSize
)
{
if
(
1
==
charSize
)
{
buffer
.
write
((
byte
)
codePoint
);
stream
.
write
((
byte
)
codePoint
);
}
else
{
}
else
{
buffer
.
write
((
byte
)
(
0xFF
&
(
codePoint
>>
16
)));
stream
.
write
((
byte
)
(
0xFF
&
(
codePoint
>>
16
)));
buffer
.
write
((
byte
)
(
0xFF
&
(
codePoint
>>
8
)));
stream
.
write
((
byte
)
(
0xFF
&
(
codePoint
>>
8
)));
buffer
.
write
((
byte
)
(
0xFF
&
codePoint
));
stream
.
write
((
byte
)
(
0xFF
&
codePoint
));
}
}
written
+=
charSize
;
written
+=
charSize
;
}
}
buffer
.
write
(
FormatSpec
.
PTNODE_CHARACTERS_TERMINATOR
);
stream
.
write
(
FormatSpec
.
PTNODE_CHARACTERS_TERMINATOR
);
written
+=
FormatSpec
.
PTNODE_TERMINATOR_SIZE
;
written
+=
FormatSpec
.
PTNODE_TERMINATOR_SIZE
;
return
written
;
return
written
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment