提交 55f9f15f authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Simplify readBoolean() and writeString() in Transfer

上级 0ff4499b
......@@ -104,7 +104,7 @@ public class Transfer {
* @return the value
*/
public boolean readBoolean() throws IOException {
return in.readByte() == 1;
return in.readByte() != 0;
}
/**
......@@ -217,11 +217,8 @@ public class Transfer {
if (s == null) {
out.writeInt(-1);
} else {
int len = s.length();
out.writeInt(len);
for (int i = 0; i < len; i++) {
out.writeChar(s.charAt(i));
}
out.writeInt(s.length());
out.writeChars(s);
}
return this;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论