org.apache.commons.httpclient
Class RequestOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--org.apache.commons.httpclient.RequestOutputStream

public class RequestOutputStream
extends java.io.OutputStream

OutputStream wrapper supporting the chunked transfer encoding.

Version:
$Revision: 1.5 $ $Date: 2001/10/04 22:20:48 $
Author:
Remy Maucherat

Constructor Summary
RequestOutputStream(java.io.OutputStream stream)
          Construct an output stream wrapping the given stream.
RequestOutputStream(java.io.OutputStream stream, boolean useChunking)
          Construct an output stream wrapping the given stream.
 
Method Summary
 void close()
          Close this output stream, causing any buffered data to be flushed and any further output data to throw an IOException.
 boolean isUseChunking()
          Use chunking flag getter.
 void print(java.lang.String s)
          Writes a String to the client, without a carriage return-line feed (CRLF) character at the end.
 void println()
          Writes a carriage return-line feed (CRLF) to the client.
 void println(java.lang.String s)
          Writes a String to the client, followed by a carriage return-line feed (CRLF).
 void setUseChunking(boolean useChunking)
          Use chunking flag setter.
 void write(byte[] b, int off, int len)
          Write the specified byte array.
 void write(int b)
          Write the specified byte to our output stream.
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestOutputStream

public RequestOutputStream(java.io.OutputStream stream)
Construct an output stream wrapping the given stream.
Parameters:
stream - Wrapped input stream

RequestOutputStream

public RequestOutputStream(java.io.OutputStream stream,
                           boolean useChunking)
Construct an output stream wrapping the given stream.
Parameters:
stream - Wrapped input stream
Method Detail

setUseChunking

public void setUseChunking(boolean useChunking)
Use chunking flag setter.

isUseChunking

public boolean isUseChunking()
Use chunking flag getter.

print

public void print(java.lang.String s)
           throws java.io.IOException
Writes a String to the client, without a carriage return-line feed (CRLF) character at the end.
Parameters:
s - the StringThrows:
java.io.IOException - if an input or output exception occurred

println

public void println()
             throws java.io.IOException
Writes a carriage return-line feed (CRLF) to the client.
Throws:
java.io.IOException - if an input or output exception occurred

println

public void println(java.lang.String s)
             throws java.io.IOException
Writes a String to the client, followed by a carriage return-line feed (CRLF).
Parameters:
s - the String to write to the client
Throws:
java.io.IOException - if an input or output exception occurred

write

public void write(int b)
           throws java.io.IOException
Write the specified byte to our output stream.
Overrides:
write in class java.io.OutputStream
Parameters:
b - The byte to be written
Throws:
java.io.IOException - if an input/output error occurs

write

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

close

public void close()
           throws java.io.IOException
Close this output stream, causing any buffered data to be flushed and any further output data to throw an IOException.
Overrides:
close in class java.io.OutputStream


Copyright (c) 2001 - Apache Software Foundation