# HG changeset patch # User one # Date 1370791266 -32400 # Node ID b82cdd44b1c1ede237b4f2d578320edea62e08ea # Parent 6fbdb09fb0e6823059c201d5a7cd72083526a73b modified PracticeEnum.java diff -r 6fbdb09fb0e6 -r b82cdd44b1c1 src/ie/oshiro/messagepack/enumpractice/PracticeEnum.java --- a/src/ie/oshiro/messagepack/enumpractice/PracticeEnum.java Sun Jun 09 23:07:43 2013 +0900 +++ b/src/ie/oshiro/messagepack/enumpractice/PracticeEnum.java Mon Jun 10 00:21:06 2013 +0900 @@ -28,6 +28,7 @@ Command convertedC = msgpack.convert(cValue, Command.class); System.out.println("convertedC = "+ convertedC); + /* Success */ ByteBuffer bb = ByteBuffer.allocate(6); bb.putChar('a'); bb.putChar('b'); @@ -35,7 +36,15 @@ Value bbValue = msgpack.unconvert(bb.array()); byte[] convertedBB = msgpack.convert(bbValue, byte[].class); String str = new String(convertedBB); - System.out.println("ByteBuffer : "+str); + System.out.println("ByteBuffer -> byte[] : "+str); + + /* Fail */ + MessagePack msgpack2 = new MessagePack(); + Value v = msgpack2.unconvert(bb); + ByteBuffer b = msgpack.convert(v, ByteBuffer.class); + String str2 = new String(b.array()); + System.out.println("ByteBuffer : "+str2); + }