Author: michiel
Date: 2009-06-03 19:30:10 +0200 (Wed, 03 Jun 2009)
New Revision: 35641

Modified:
   mmbase/trunk/src/org/mmbase/util/SerializableInputStream.java
Log:
completer toString

Modified: mmbase/trunk/src/org/mmbase/util/SerializableInputStream.java
===================================================================
--- mmbase/trunk/src/org/mmbase/util/SerializableInputStream.java       
2009-06-03 16:33:59 UTC (rev 35640)
+++ mmbase/trunk/src/org/mmbase/util/SerializableInputStream.java       
2009-06-03 17:30:10 UTC (rev 35641)
@@ -275,10 +275,20 @@
 
     @Override
     public String toString() {
-        return "SERIALIZABLE " + wrapped + " (" + size + " byte, " +
+        long filePos = -1;
+        try {
+            filePos = wrapped instanceof FileInputStream ? ((FileInputStream) 
wrapped).getChannel().position() : 0;
+        } catch (IOException ioe) {
+            log.warn(ioe);
+        }
+        return "SERIALIZABLE " + wrapped +
+            (tempFile ? (" (tempfile: " + file + ") ") : (file != null ? ("(" 
+ file + ")") : "")) +
+            " (" + size + " byte, " +
             (name == null ? "[no name]" : name) +
             ", " +
             (contentType == null ? "[no contenttype]" : contentType) +
+            (fileMark > 0 ? (" mark: " + fileMark) : "") +
+            (filePos > 0 ? (" position: " + filePos) : "") +
             ")";
     }
 

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to