Switched from Moquette's MQTT codec to Netty's MQTT codec ones

This commit is contained in:
andsel
2017-01-28 15:59:44 +01:00
parent 07093ab0cb
commit 1c64186a00
53 changed files with 1571 additions and 1048 deletions
@@ -15,6 +15,8 @@
*/
package io.moquette.spi.impl;
import io.netty.buffer.ByteBuf;
import java.nio.ByteBuffer;
/**
@@ -22,11 +24,16 @@ import java.nio.ByteBuffer;
* @author andrea
*/
class DebugUtils {
static String payload2Str(ByteBuffer content) {
static String payload2Str(ByteBuffer content) {
byte[] b = new byte[content.remaining()];
content.mark();
content.get(b);
content.reset();
return new String(b);
}
}
static String payload2Str(ByteBuf content) {
//byte[] b = new byte[content.readableBytes()];
return new String(content.copy().array());
}
}