Revision: 6449
http://jython.svn.sourceforge.net/jython/?rev=6449&view=rev
Author: pjenvey
Date: 2009-06-04 07:29:23 +0000 (Thu, 04 Jun 2009)
Log Message:
-----------
enable flushing of StreamIOs' associated OutputStreams
thanks Marcelo Taube
refs #1367
Modified Paths:
--------------
trunk/jython/src/org/python/core/io/StreamIO.java
Modified: trunk/jython/src/org/python/core/io/StreamIO.java
===================================================================
--- trunk/jython/src/org/python/core/io/StreamIO.java 2009-06-04 07:24:35 UTC (rev 6448)
+++ trunk/jython/src/org/python/core/io/StreamIO.java 2009-06-04 07:29:23 UTC (rev 6449)
@@ -17,7 +17,6 @@
import java.nio.channels.WritableByteChannel;
import org.python.core.Py;
-import org.python.core.imp;
import org.python.core.util.FileUtil;
/**
@@ -135,6 +134,20 @@
}
/** {@inheritDoc} */
+ public void flush() {
+ checkClosed();
+ checkWritable();
+ if (outputStream == null) {
+ return;
+ }
+ try {
+ outputStream.flush();
+ } catch (IOException ioe) {
+ throw Py.IOError(ioe);
+ }
+ }
+
+ /** {@inheritDoc} */
public void close() {
if (closed()) {
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|