net.i2p.i2ptunnel
Class HTTPResponseOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended bynet.i2p.i2ptunnel.HTTPResponseOutputStream

class HTTPResponseOutputStream
extends java.io.FilterOutputStream

Simple stream for delivering an HTTP response to the client, trivially filtered to make sure "Connection: close" is always in the response.


Field Summary
protected  ByteArray _headerBuffer
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
HTTPResponseOutputStream(java.io.OutputStream raw)
           
 
Method Summary
protected  java.lang.String filterResponseLine(java.lang.String line)
          Tweak that first HTTP response line (HTTP 200 OK, etc)
static void main(java.lang.String[] args)
           
 void write(byte[] buf)
           
 void write(byte[] buf, int off, int len)
           
 void write(int c)
           
 
Methods inherited from class java.io.FilterOutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_headerBuffer

protected ByteArray _headerBuffer
Constructor Detail

HTTPResponseOutputStream

public HTTPResponseOutputStream(java.io.OutputStream raw)
Method Detail

write

public void write(int c)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] buf)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] buf,
                  int off,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException

filterResponseLine

protected java.lang.String filterResponseLine(java.lang.String line)
Tweak that first HTTP response line (HTTP 200 OK, etc)


main

public static void main(java.lang.String[] args)