Пример #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());
   }
 }
Пример #2
0
 private static void printArray(OutputStream stream, Object[] array) {
   List<Object> list = Arrays.asList(array);
   printIterable(stream, list);
 }