diff --git a/src/main/java/io/github/sac/codec/BasicCodecEngine.java b/src/main/java/io/github/sac/codec/BasicCodecEngine.java
new file mode 100644
index 0000000..0feac98
--- /dev/null
+++ b/src/main/java/io/github/sac/codec/BasicCodecEngine.java
@@ -0,0 +1,27 @@
+package io.github.sac.codec;
+
+import io.github.sac.codec.CodecEngine;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.nio.charset.Charset;
+
+/**
+ *
Created by AUT0CRAT on 2/2/18.
+ */
+public class BasicCodecEngine extends CodecEngine {
+ @Override
+ public byte[] encode(JSONObject data) {
+ return data.toString().getBytes();
+ }
+
+ @Override
+ public byte[] encode(String data) {
+ return data.getBytes();
+ }
+
+ @Override
+ public String decode(byte[] data) {
+ return new String(data, Charset.defaultCharset());
+ }
+}
diff --git a/src/main/java/io/github/sac/codec/CodecEngine.java b/src/main/java/io/github/sac/codec/CodecEngine.java
new file mode 100644
index 0000000..2e7a888
--- /dev/null
+++ b/src/main/java/io/github/sac/codec/CodecEngine.java
@@ -0,0 +1,14 @@
+package io.github.sac.codec;
+
+import org.json.JSONObject;
+
+/**
+ *
Created by AUT0CRAT on 2/2/18.
+ */
+public abstract class CodecEngine {
+ abstract public byte[] encode(JSONObject data);
+
+ abstract public byte[] encode(String data);
+
+ abstract public String decode(byte[] data);
+}
diff --git a/src/main/java/io/github/sac/codec/MessagePacketCodec.java b/src/main/java/io/github/sac/codec/MessagePacketCodec.java
new file mode 100644
index 0000000..441f2e0
--- /dev/null
+++ b/src/main/java/io/github/sac/codec/MessagePacketCodec.java
@@ -0,0 +1,200 @@
+package io.github.sac.codec;
+
+import io.github.sac.codec.CodecEngine;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.msgpack.core.MessageBufferPacker;
+import org.msgpack.core.MessagePack;
+import org.msgpack.core.MessageUnpacker;
+import org.msgpack.value.ImmutableValue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Implementation of Binary message packet code. It is based on min-bin codec
+ *
+ *
Created by AUT0CRAT on 2/2/18.
+ */
+public class MessagePacketCodec extends CodecEngine {
+ @Override
+ public byte[] encode(JSONObject jsonObject) {
+ MessageBufferPacker packer = MessagePack.newDefaultBufferPacker();
+ ArrayList