From c40928cd674144fa5ed3dc7306c33b16823b2fad Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 9 Jun 2018 11:53:11 +1200 Subject: Use slices instead of new buffers --- src/org/traccar/protocol/Gt02ProtocolDecoder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/org/traccar/protocol/Gt02ProtocolDecoder.java') diff --git a/src/org/traccar/protocol/Gt02ProtocolDecoder.java b/src/org/traccar/protocol/Gt02ProtocolDecoder.java index 83be9d996..ab4c7022e 100644 --- a/src/org/traccar/protocol/Gt02ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt02ProtocolDecoder.java @@ -55,7 +55,7 @@ public class Gt02ProtocolDecoder extends BaseProtocolDecoder { int power = buf.readUnsignedByte(); int gsm = buf.readUnsignedByte(); - String imei = ByteBufUtil.hexDump(buf.readBytes(8)).substring(1); + String imei = ByteBufUtil.hexDump(buf.readSlice(8)).substring(1); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, imei); if (deviceSession == null) { return null; @@ -110,7 +110,7 @@ public class Gt02ProtocolDecoder extends BaseProtocolDecoder { getLastLocation(position, null); position.set(Position.KEY_RESULT, - buf.readBytes(buf.readUnsignedByte()).toString(StandardCharsets.US_ASCII)); + buf.readSlice(buf.readUnsignedByte()).toString(StandardCharsets.US_ASCII)); } else { -- cgit v1.2.3