juglr.net
Class HTTPRequestWriter

java.lang.Object
  extended by juglr.net.HTTPWriter
      extended by juglr.net.HTTPRequestWriter

public class HTTPRequestWriter
extends HTTPWriter

Writer-like interface for constructing HTTP requests


Field Summary
 
Fields inherited from class juglr.net.HTTPWriter
buf, channel
 
Constructor Summary
HTTPRequestWriter(java.nio.channels.SocketChannel channel)
           
HTTPRequestWriter(java.nio.channels.SocketChannel channel, java.nio.ByteBuffer buf)
           
 
Method Summary
 HTTPRequestWriter reset(java.nio.channels.SocketChannel channel)
          Clear all state and reset the writer to start writing a new response tp channel.
 void writeMethod(HTTP.Method method)
           
 void writeUri(java.lang.CharSequence uri)
           
 void writeVersion(HTTP.Version version)
           
 
Methods inherited from class juglr.net.HTTPWriter
close, flush, startBody, writeBody, writeBody, writeBody, writeBody, writeHeader, writeLF, writeSpace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPRequestWriter

public HTTPRequestWriter(java.nio.channels.SocketChannel channel,
                         java.nio.ByteBuffer buf)

HTTPRequestWriter

public HTTPRequestWriter(java.nio.channels.SocketChannel channel)
Method Detail

reset

public HTTPRequestWriter reset(java.nio.channels.SocketChannel channel)
                        throws java.io.IOException
Clear all state and reset the writer to start writing a new response tp channel. If the previous channel is open it will be closed.

Parameters:
channel - the new socket channel to write to
Returns:
always returns this
Throws:
java.io.IOException - if the previous channel was open and there was an error when closing it

writeMethod

public void writeMethod(HTTP.Method method)
                 throws java.io.IOException
Throws:
java.io.IOException

writeUri

public void writeUri(java.lang.CharSequence uri)
              throws java.io.IOException
Throws:
java.io.IOException

writeVersion

public void writeVersion(HTTP.Version version)
                  throws java.io.IOException
Overrides:
writeVersion in class HTTPWriter
Throws:
java.io.IOException