diff options
author | Gavriel Fleischer <flocsy@gmail.com> | 2019-02-17 01:24:44 +0200 |
---|---|---|
committer | Gavriel Fleischer <flocsy@gmail.com> | 2019-02-17 01:24:44 +0200 |
commit | 4b9aa8e7c98a3420a698b1520ee63060409c7d88 (patch) | |
tree | 8598434570526fe27d832271a155e8a47f154fef /test/org/traccar/ProtocolTest.java | |
parent | c1de08db7773eef6b1ed4a6e2b62f15d1df6a2a5 (diff) | |
download | traccar-server-4b9aa8e7c98a3420a698b1520ee63060409c7d88.tar.gz traccar-server-4b9aa8e7c98a3420a698b1520ee63060409c7d88.tar.bz2 traccar-server-4b9aa8e7c98a3420a698b1520ee63060409c7d88.zip |
binary encoder + test
Diffstat (limited to 'test/org/traccar/ProtocolTest.java')
-rw-r--r-- | test/org/traccar/ProtocolTest.java | 8 |
1 files changed, 8 insertions, 0 deletions
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))); } |