From 4b9aa8e7c98a3420a698b1520ee63060409c7d88 Mon Sep 17 00:00:00 2001 From: Gavriel Fleischer Date: Sun, 17 Feb 2019 01:24:44 +0200 Subject: binary encoder + test --- test/org/traccar/ProtocolTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/org/traccar/ProtocolTest.java') diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 1b5c0ea00..181af885d 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -52,6 +52,14 @@ public class ProtocolTest extends BaseTest { return builder.toString(); } + protected ByteBuf concatenateBuffers(ByteBuf... buffers) { + ByteBuf result = Unpooled.buffer(); + for (ByteBuf buf : buffers) { + result.writeBytes(buf); + } + return result; + } + protected ByteBuf binary(String... data) { return Unpooled.wrappedBuffer(DataConverter.parseHex(concatenateStrings(data))); } -- cgit v1.2.3