org.apache.jetspeed.services.jsp
Class PrintWriterServletOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjavax.servlet.ServletOutputStream
          extended byorg.apache.jetspeed.services.jsp.PrintWriterServletOutputStream

public class PrintWriterServletOutputStream
extends javax.servlet.ServletOutputStream

This is a specialized class implementing a ServletOutputStream that works in conjunction with a PrintWriter to send data to the browser. It is used when a J2EE server throws an IllegalStateException when you call getOutputStream on a response which someone has previously called getWriter on.


Constructor Summary
PrintWriterServletOutputStream(java.io.PrintWriter pO)
          Deprecated. since 1.0RC3; use PrintWriterServletOutputStream

Construct a ServletOutputStream that coordinates output using a base ServletOutputStream and a PrintWriter that is wrapped on top of that OutputStream.

PrintWriterServletOutputStream(java.io.PrintWriter pw, java.lang.String encoding)
           
 
Method Summary
 void close()
          Closes the stream
 void flush()
          Flushes the stream, writing any buffered output bytes
 void print(java.lang.String pVal)
          Prints a string.
 void println()
          Prints a CRLF
 void println(java.lang.String pVal)
          Prints an string followed by a CRLF.
 void write(byte[] pBuf)
          Writes an array of bytes
 void write(byte[] pBuf, int pOffset, int pLength)
          Writes a subarray of bytes This implementation redirects it's input into the underlying PrintWriter.
 void write(int pVal)
          Writes a single byte to the output stream This implementation writes the byte to the underlying PrintWriter.
 
Methods inherited from class javax.servlet.ServletOutputStream
print, print, print, print, print, print, println, println, println, println, println, println
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintWriterServletOutputStream

public PrintWriterServletOutputStream(java.io.PrintWriter pO)
Deprecated. since 1.0RC3; use PrintWriterServletOutputStream

Construct a ServletOutputStream that coordinates output using a base ServletOutputStream and a PrintWriter that is wrapped on top of that OutputStream.


PrintWriterServletOutputStream

public PrintWriterServletOutputStream(java.io.PrintWriter pw,
                                      java.lang.String encoding)
Method Detail

write

public void write(int pVal)
           throws java.io.IOException
Writes a single byte to the output stream This implementation writes the byte to the underlying PrintWriter.

Throws:
java.io.IOException

write

public void write(byte[] pBuf)
           throws java.io.IOException
Writes an array of bytes

Parameters:
pBuf - the array to be written
Throws:
java.io.IOException - if an I/O error occurred

write

public void write(byte[] pBuf,
                  int pOffset,
                  int pLength)
           throws java.io.IOException
Writes a subarray of bytes This implementation redirects it's input into the underlying PrintWriter.

Parameters:
pBuf - the array to be written
pOffset - the offset into the array
pLength - the number of bytes to write
Throws:
java.io.IOException - if an I/O error occurred

flush

public void flush()
           throws java.io.IOException
Flushes the stream, writing any buffered output bytes

Throws:
java.io.IOException - if an I/O error occurred

close

public void close()
           throws java.io.IOException
Closes the stream

Throws:
java.io.IOException - if an I/O error occurred

print

public void print(java.lang.String pVal)
           throws java.io.IOException
Prints a string.

Parameters:
pVal - the String to be printed
Throws:
java.io.IOException - if an I/O error has occurred

println

public void println(java.lang.String pVal)
             throws java.io.IOException
Prints an string followed by a CRLF.

Parameters:
pVal - the String to be printed
Throws:
java.io.IOException - if an I/O error has occurred

println

public void println()
             throws java.io.IOException
Prints a CRLF

Throws:
java.io.IOException - if an I/O error has occurred


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.