From 216946bc454a3bedbe8bd3b7c10366dff83db9c9 Mon Sep 17 00:00:00 2001 From: zhangji <125540670@qq.com> Date: Thu, 9 Mar 2023 10:12:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(TCP=E5=8D=8F=E8=AE=AE):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=AD=97=E7=AC=A6=E4=B8=B2=E4=B8=AD=E6=96=87=E4=B9=B1?= =?UTF-8?q?=E7=A0=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jetlinks/protocol/official/binary/DataType.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jetlinks/protocol/official/binary/DataType.java b/src/main/java/org/jetlinks/protocol/official/binary/DataType.java index 92280ca..67eaf57 100644 --- a/src/main/java/org/jetlinks/protocol/official/binary/DataType.java +++ b/src/main/java/org/jetlinks/protocol/official/binary/DataType.java @@ -157,9 +157,9 @@ public enum DataType { @Override public void write(ByteBuf buf, Object value) { - String str = (String) value; - buf.writeShort(str.length()); - buf.writeBytes(str.getBytes()); + byte[] bytes = ((String) value).getBytes(); + buf.writeShort(bytes.length); + buf.writeBytes(bytes); } }, //0x0C