提交 f967491f 编写于 作者: Z Zihan Meng 提交者: Xiangdong Huang

Tried to solve issue 140

上级 33af5f19
......@@ -69,7 +69,7 @@ public class ChunkHeader {
}
public static int getSerializedSize(String measurementID) {
return Byte.BYTES + Integer.BYTES + getSerializedSize(measurementID.length());
return Byte.BYTES + Integer.BYTES + getSerializedSize(measurementID.getBytes().length);
}
private static int getSerializedSize(int measurementIdLength) {
......
......@@ -229,8 +229,8 @@ public class ReadWriteIOUtils {
*/
public static int write(String s, OutputStream outputStream) throws IOException {
int len = 0;
len += write(s.length(), outputStream);
byte[] bytes = s.getBytes();
len += write(bytes.length, outputStream);
outputStream.write(bytes);
len += bytes.length;
return len;
......@@ -243,8 +243,8 @@ public class ReadWriteIOUtils {
*/
public static int write(String s, ByteBuffer buffer) {
int len = 0;
len += write(s.length(), buffer);
byte[] bytes = s.getBytes();
len += write(bytes.length, buffer);
buffer.put(bytes);
len += bytes.length;
return len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册