import org.msgpack.core.MessagePack;
import org.msgpack.core.MessageUnpacker;

public void doPost(HttpServletRequest request, HttpServletResponse response)

    throws ServletException, IOException {

        System.out.println("doPost");

        InputStream in = request.getInputStream();

        MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(in);

        intmaplen = unpacker.unpackMapHeader();

        System.out.println("key:"+ unpacker.unpackString());

        System.out.println("value:"+ unpacker.unpackString());

        System.out.println("key:"+ unpacker.unpackString());

        System.out.println("value:"+ unpacker.unpackInt());

        System.out.println("key:"+ unpacker.unpackString());

        System.out.println("value:"+ unpacker.unpackInt());

        System.out.println("key:"+ unpacker.unpackString());

        System.out.println("value:"+ unpacker.unpackString());

        System.out.println("key:"+ unpacker.unpackString());

        System.out.println("value:"+ unpacker.unpackString());

        System.out.println("key:"+ unpacker.unpackString());

        intarrHeader = unpacker.unpackArrayHeader();

        System.out.println("value BinaryHeader:"+ arrHeader);

        for(inti = 0; i < arrHeader; i++) {

            intbinaryHeader = unpacker.unpackBinaryHeader();

            byte[] bytes = newbyte[binaryHeader];

            unpacker.readPayload(bytes);

            System.out.println("bytes hexString:"+ bytes2HexStr(bytes));

        }

        System.out.println("---------------------------------");

        unpacker.close();

    }



public static String bytes2HexStr(byte[] bytes) {

    char[] hexChars = newchar[bytes.length * 2];

    for(intj = 0; j < bytes.length; j++) {

        intv = bytes[j] & 0xFF;

        hexChars[j * 2] = hexArray[v >>> 4];

        hexChars[j * 2+ 1] = hexArray[v & 0x0F];

    }

    returnnewString(hexChars);

}

@@ -368,16 +368,17 @@
      int
+ 
 maplen =
@@ -1104,16 +1104,17 @@
      int
+ 
 arrHeade
@@ -1226,16 +1226,17 @@
  for(int
+ 
 i = 0; i
@@ -1272,16 +1272,17 @@
      int
+ 
 binaryHe
@@ -1350,16 +1350,17 @@
 es = new
+ 
 byte%5Bbin
@@ -1600,17 +1600,50 @@
     %7D%0A%0A%0A
-%0A
+    /*%E8%BE%93%E5%85%A516%E8%BF%9B%E5%88%B6byte%5B%5D%E8%BE%93%E5%87%BA16%E8%BF%9B%E5%88%B6%E5%AD%97%E7%AC%A6%E4%B8%B2*/%0A    
 public s
@@ -1683,14 +1683,149 @@
 byte
-s) %7B%0A%0A
+Array) %7B%0A        if (byteArray == null) %7B%0A            return null;%0A        %7D%0A        char%5B%5D hexArray = %220123456789ABCDEF%22.toCharArray();%0A    
     
@@ -1845,16 +1845,17 @@
 rs = new
+ 
 char%5Bbyt
@@ -1851,25 +1851,29 @@
 ew char%5Bbyte
-s
+Array
 .length * 2%5D
@@ -1878,20 +1878,25 @@
 2%5D;%0A
-%0A
+    
     for
+ 
 (int
+ 
 j = 
@@ -1906,17 +1906,21 @@
 j %3C byte
-s
+Array
 .length;
@@ -1923,25 +1923,28 @@
 gth; j++) %7B%0A
-%0A
+    
         intv
@@ -1946,16 +1946,17 @@
  int
+ 
 v = byte
 s%5Bj%5D
@@ -1951,17 +1951,21 @@
 v = byte
-s
+Array
 %5Bj%5D & 0x
@@ -1968,25 +1968,24 @@
 & 0xFF;%0A
-%0A
         
 hexChars
@@ -1968,32 +1968,36 @@
 & 0xFF;%0A        
+    
 hexChars%5Bj * 2%5D 
@@ -2017,17 +2017,20 @@
 %3E%3E%3E 4%5D;%0A
-%0A
+    
         
@@ -2043,16 +2043,17 @@
 rs%5Bj * 2
+ 
 + 1%5D = h
@@ -2071,24 +2071,30 @@
  0x0F%5D;%0A
-%0A
+    
     %7D%0A
-%0A
+    
     retu
@@ -2095,19 +2095,21 @@
   return
+ 
 new
+ 
 String(h
@@ -2118,11 +2118,18 @@
 Chars);%0A
+    %7D%0A%0A
 %0A%7D%0A

fix syntax. Thanks for @littleBear