org.mortbay.http
Class NullableOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.FilterOutputStream
              |
              +--org.mortbay.http.NullableOutputStream
All Implemented Interfaces:
HttpMessage.HeaderWriter

public class NullableOutputStream
extends java.io.FilterOutputStream
implements HttpMessage.HeaderWriter

Buffered Output Stream. Uses ByteBufferOutputStream to allow pre and post writes.

Version:
$Revision: 1.2 $
Author:
Greg Wilkins (gregw)

Constructor Summary
NullableOutputStream(java.io.OutputStream outputStream, int headerReserve)
           
 
Method Summary
 void close()
          Close the stream.
 void destroy()
           
 void flush()
           
 boolean isNullOutput()
          is the output Nulled?
 void nullOutput()
          Null the output.
 void resetStream()
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeHeader(HttpMessage httpMessage)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullableOutputStream

public NullableOutputStream(java.io.OutputStream outputStream,
                            int headerReserve)
Method Detail

nullOutput

public void nullOutput()
                throws java.io.IOException
Null the output. All output written is discarded until the stream is reset. Used for HEAD requests.

java.io.IOException

isNullOutput

public boolean isNullOutput()
                     throws java.io.IOException
is the output Nulled?

java.io.IOException

writeHeader

public void writeHeader(HttpMessage httpMessage)
                 throws java.io.IOException
Specified by:
writeHeader in interface HttpMessage.HeaderWriter
java.io.IOException

resetStream

public void resetStream()

destroy

public void destroy()

write

public void write(int b)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
java.io.IOException

write

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

write

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

flush

public void flush()
           throws java.io.IOException
Overrides:
flush in class java.io.FilterOutputStream
java.io.IOException

close

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

Overrides:
close in class java.io.FilterOutputStream
Throws:
java.io.IOException


Copyright ? 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.