示例#1
0
 private static void print(OutputStream stream, Object object) {
   if (object == null) {
     printBytes(stream, "(null)".getBytes());
   } else if (object instanceof Iterable) {
     printIterable(stream, (Iterable) object);
   } else if (object instanceof Throwable) {
     printThrowable(stream, (Throwable) object);
   } else if (object.getClass().isArray()) {
     Object[] array = toObjectArray(object);
     printArray(stream, array);
   } else {
     printBytes(stream, object.toString().getBytes());
   }
 }