THRIFT-3679 Add stdout log to testBinary in Java test server
Client: Test (Java)
Patch: Nobuaki Sukegawa

This closes #899
diff --git a/lib/java/test/org/apache/thrift/server/ServerTestBase.java b/lib/java/test/org/apache/thrift/server/ServerTestBase.java
index bc1fb96..8cbb934 100755
--- a/lib/java/test/org/apache/thrift/server/ServerTestBase.java
+++ b/lib/java/test/org/apache/thrift/server/ServerTestBase.java
@@ -92,8 +92,13 @@
     }
 
     public ByteBuffer testBinary(ByteBuffer thing) {
-      String hexstr = "TODO: toHexString(thing)";
-	  System.out.print("testBinary(" + hexstr + ")\n");
+      StringBuilder sb = new StringBuilder(thing.remaining() * 3);
+      thing.mark();
+      while (thing.remaining() > 0) {
+        sb.append(String.format("%02X ", thing.get()));
+      }
+      System.out.print("testBinary(" + sb.toString() + ")\n");
+      thing.reset();
       return thing;
     }