abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r589179 - /incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONStream.java
Date Sat, 27 Oct 2007 19:00:09 GMT
Author: jmsnell
Date: Sat Oct 27 12:00:08 2007
New Revision: 589179

URL: http://svn.apache.org/viewvc?rev=589179&view=rev
Log:
Flush the stream more often

Modified:
    incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONStream.java

Modified: incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONStream.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONStream.java?rev=589179&r1=589178&r2=589179&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONStream.java
(original)
+++ incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONStream.java
Sat Oct 27 12:00:08 2007
@@ -63,16 +63,19 @@
   private void writeIndent() throws IOException {
     for (int n = 0; n < depth; n++)
       writer.write(' ');
+    writer.flush();
   }
   
   private void writeNewLine() throws IOException {
     writer.write('\n');
+    writer.flush();
   }
   
   public void startObject() throws IOException {
     writer.write('{');
     inc();
     pushStack();
+    writer.flush();
   }
   
   public void endObject() throws IOException {
@@ -81,11 +84,13 @@
     writeNewLine();
     writeIndent();
     writer.write('}');
+    writer.flush();
   }
   
   public void startArray() throws IOException {
     writer.write('[');
     inc();
+    writer.flush();
   }
   
   public void endArray() throws IOException {
@@ -93,20 +98,24 @@
     writeNewLine();
     writeIndent();
     writer.write(']');
+    writer.flush();
   }
 
   public void writeSeparator() throws IOException {
     writer.write(',');
+    writer.flush();
   }
   
   private void writeColon() throws IOException {
     writer.write(':');
+    writer.flush();
   }
   
   public void writeQuoted(String value) throws IOException {
     writer.write('"');
     writer.write(escape(value));
     writer.write('"');
+    writer.flush();
   }
 
   public void writeField(String name) throws IOException {
@@ -114,7 +123,7 @@
     writeNewLine();
     writeIndent();
     writeQuoted(name);
-    writeColon();    
+    writeColon();
   }
 
   
@@ -147,6 +156,7 @@
       writeField(name);
       writer.write(value.toString());
     }
+    writer.flush();
   }
 
   public void writeField(String name, Boolean value) throws IOException {
@@ -154,6 +164,7 @@
       writeField(name);
       writer.write(value.toString());
     }
+    writer.flush();
   }
   
   private static String escape(String value) {



Mime
View raw message