mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-20 09:17:29 +07:00
Implemented writeString(CharSequence,int)
This commit is contained in:
parent
2433fac1fe
commit
984a0864ea
@ -190,4 +190,17 @@ public class BitOutput {
|
|||||||
write64(value, Long.SIZE);
|
write64(value, Long.SIZE);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BitOutput writeString(CharSequence chars, int bits) {
|
||||||
|
BitConstraints.validateAscii(bits);
|
||||||
|
|
||||||
|
final int length = chars.length();
|
||||||
|
if (length == 0) return this;
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
final char c = chars.charAt(i);
|
||||||
|
_writeRaw(c, bits);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user