You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Harshini Madurapperuma <ha...@ifs.lk> on 2007/04/04 14:15:18 UTC

Stream Closed Exception !! Need Help

 


Hi All;

In fop Driver class there is a method called
  
public synchronized void render(XMLReader parser, InputSource source)
                throws FOPException {
	
	}

Is there a way to convert that InputSource "source" back into a character
array within that render class? I tried to do it by this way but it throws a
"Stream Closed" Exception.
----------------------------------------------------------------------------
--
if (source.getCharacterStream() != null) {
	BufferedReader reader = new
BufferedReader(source.getCharacterStream());
      CharArrayWriter writer=new CharArrayWriter();
      int i=-1;
      while ((i=reader.read())!=-1)
          {
            writer.write(i);
           }
           reader.close();
           writer.close();
   }
----------------------------------------------------------------------------
----
EXCEPTION-------------------------------------------------------------------
----

java.io.IOException: Stream closed         at
java.io.CharArrayReader.ensureOpen(CharArrayReader.java:65)         at
java.io.CharArrayReader.read(CharArrayReader.java:95)         at
java.io.BufferedReader.fill(BufferedReader.java:136)         at
java.io.BufferedReader.read(BufferedReader.java:157)         at
org.apache.fop.apps.Driver.render(Driver.java:557)
----------------------------------------------------------------------------
-----
  
I'm using java as the language. Pls ur help will be greatly appreciated
Thanx Harshini.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org