Skip to content
Browse files

JsonWriter implements java.io.Flushable

  • Loading branch information...
1 parent 6c0f2fc commit 33d29a01d1c228f6651a450c1939bd238d82dd0b @ropalka ropalka committed Oct 29, 2012
View
6 modules/api/src/main/java/org/fossnova/json/stream/JsonWriter.java
@@ -20,6 +20,7 @@
package org.fossnova.json.stream;
import java.io.Closeable;
+import java.io.Flushable;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -29,7 +30,7 @@
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
* @see JsonStreamFactory
*/
-public interface JsonWriter extends Closeable {
+public interface JsonWriter extends Flushable, Closeable {
/**
* Writes JSON <code>object start</code> token.
@@ -163,10 +164,9 @@
/**
* Writes all cached data.
- * @return this writer instance
* @throws IOException if some I/O error occurs
*/
- JsonWriter flush() throws IOException;
+ void flush() throws IOException;
/**
* Free resources associated with this writer. Never closes underlying input stream or writer.
View
3 modules/impl/src/main/java/com/fossnova/json/stream/JsonWriterImpl.java
@@ -58,10 +58,9 @@ public void close() {
closed = true;
}
- public JsonWriterImpl flush() throws IOException {
+ public void flush() throws IOException {
ensureOpen();
out.flush();
- return this;
}
public JsonWriterImpl writeObjectStart() throws IOException, JsonException {

0 comments on commit 33d29a0

Please sign in to comment.
Something went wrong with that request. Please try again.