org.apache.tomcat.facade
Class ServletOutputStreamFacade

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--javax.servlet.ServletOutputStream
              |
              +--org.apache.tomcat.facade.ServletOutputStreamFacade

public final class ServletOutputStreamFacade
extends javax.servlet.ServletOutputStream


Field Summary
protected  boolean closed
           
 
Constructor Summary
protected ServletOutputStreamFacade(Response resA)
           
 
Method Summary
 void close()
           
 void flush()
          Will send the buffer to the client.
 void print(java.lang.String s)
          Alternate implementation for print, using String.getBytes(enc).
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int i)
           
 
Methods inherited from class javax.servlet.ServletOutputStream
print, print, print, print, print, print, println, println, println, println, println, println, println, println
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

closed

protected boolean closed
Constructor Detail

ServletOutputStreamFacade

protected ServletOutputStreamFacade(Response resA)
Method Detail

write

public void write(int i)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream

write

public void write(byte[] b)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream

print

public void print(java.lang.String s)
           throws java.io.IOException
Alternate implementation for print, using String.getBytes(enc). It seems to be a bit faster for small strings, but it's 10..20% slower for larger texts ( nor very large - 5..10k ) That seems to be mostly because of byte b[] - the writer has an internal ( and fixed ) buffer. Please use getWriter() if you want to send strings.
Overrides:
print in class javax.servlet.ServletOutputStream

flush

public void flush()
           throws java.io.IOException
Will send the buffer to the client.
Overrides:
flush in class java.io.OutputStream

close

public void close()
           throws java.io.IOException
Overrides:
close in class java.io.OutputStream


Copyright © 2001 Apache Software Foundation. All Rights Reserved.