@Override
public void writeUTF(String str) throws IOException {
int utfCount = 0, length = str.length();
for (int i = 0; i < length; i++) {
int charValue = str.charAt(i);
if (charValue > 0 && charValue <= 127) {
utfCount++;
} else if (charValue <= 2047) {
utfCount += 2;
} else {
utfCount += 3;
}
}
if (utfCount > 65535) {
throw new UTFDataFormatException(); //$NON-NLS-1$
}
position += utfCount * 2;
}
PurgeStatisticBackend.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:cassandra-sstable-tools
作者:
评论列表
文章目录