tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/runtime BodyContentImpl.java
Date Tue, 26 Oct 1999 01:04:16 GMT
mode        99/10/25 18:04:15

  Modified:    src/share/org/apache/jasper/runtime Tag:
                        TOMCAT_J2EE_10F_102199 BodyContentImpl.java
  Log:
  Changes to make the flush compliant to spec. Added stuff to the close and clear methods
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +16 -27    jakarta-tomcat/src/share/org/apache/jasper/runtime/BodyContentImpl.java
  
  Index: BodyContentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/BodyContentImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- BodyContentImpl.java	1999/10/17 08:23:34	1.2
  +++ BodyContentImpl.java	1999/10/26 01:04:13	1.2.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Id: BodyContentImpl.java,v 1.2 1999/10/17 08:23:34 mode Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/17 08:23:34 $
  + * $Id: BodyContentImpl.java,v 1.2.2.1 1999/10/26 01:04:13 mode Exp $
  + * $Revision: 1.2.2.1 $
  + * $Date: 1999/10/26 01:04:13 $
    *
    * ====================================================================
    * 
  @@ -503,6 +503,11 @@
        */
   
       public void clear() throws IOException {
  +        synchronized (lock) {
  +            cb = new char [Constants.DEFAULT_BUFFER_SIZE];
  +	    bufferSize = Constants.DEFAULT_BUFFER_SIZE;
  +	    nextChar = 0;
  +	}
       }
   
       /**
  @@ -515,22 +520,10 @@
        */
   
       public void clearBuffer() throws IOException {
  +        this.clear();
       }
   
       /**
  -     * Flush the stream.  If the stream has saved any characters from the
  -     * various write() methods in a buffer, write them immediately to their
  -     * intended destination.  Then, if that destination is another character or
  -     * byte stream, flush it.  Thus one flush() invocation will flush all the
  -     * buffers in a chain of Writers and OutputStreams.
  -     *
  -     * @exception  IOException  If an I/O error occurs
  -     */
  -
  -    public void flush()  throws IOException {
  -    }
  -
  -    /**
        * Close the stream, flushing it first.  Once a stream has been closed,
        * further write() or flush() invocations will cause an IOException to be
        * thrown.  Closing a previously-closed stream, however, has no effect.
  @@ -539,6 +532,9 @@
        */
   
       public void close() throws IOException {
  +        synchronized (lock) {
  +	    cb = null;	
  +	}
       }
   
       /**
  @@ -587,19 +583,12 @@
        * @param out The writer into which to place the contents of
        * this body evaluation
        */
  -    public void writeOut(Writer out) {
  -	try {
  -            out.write (cb);
  -	} catch (IOException ioe) {
  -	    //What do we do here???	
  -	}
  +    public void writeOut(Writer out) throws IOException {
  +        out.write (cb);
  +	//Flush not called as the writer passed could be a BodyContent and
  +	//it doesn't allow to flush.
       }
   
  -    public void clearBody() {
  -        nextChar = 0;
  -	cb = null;
  -	bufferSize = Constants.DEFAULT_BUFFER_SIZE;
  -    }
   
       public static void main (String[] args) throws Exception {
   	char[] buff = {'f','o','o','b','a','r','b','a','z','y'};
  
  
  

Mime
View raw message