juglr.net
Class HTTPResponseReader
java.lang.Object
juglr.net.HTTPReader
juglr.net.HTTPResponseReader
public class HTTPResponseReader
- extends HTTPReader
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HTTPResponseReader
public HTTPResponseReader(java.nio.channels.SocketChannel channel,
java.nio.ByteBuffer buf)
HTTPResponseReader
public HTTPResponseReader(java.nio.channels.SocketChannel channel)
reset
public HTTPResponseReader reset(java.nio.channels.SocketChannel channel)
throws java.io.IOException
- Description copied from class:
HTTPReader
- Reset all state in the reader, preparing it for reading
channel
.
- Overrides:
reset
in class HTTPReader
- Parameters:
channel
- the channel to start reading from. If the reader refers
a channel then this channel will be closed.
- Returns:
- always returns
this
- Throws:
java.io.IOException
- if the reader already refers an open channel and
there is an error closing it
readVersion
public HTTP.Version readVersion()
throws java.io.IOException
- Description copied from class:
HTTPReader
- Parse a HTTP protocol version declaration as used in the HTTP
protocol. The buffer will be positioned just after the last parsed
character upon method return
- Overrides:
readVersion
in class HTTPReader
- Returns:
- the HTTP version or
HTTP.Version.ERROR
on errors
- Throws:
java.io.IOException
- upon errors reading from the socket
readStatus
public HTTP.Status readStatus()
throws java.io.IOException
- Description copied from class:
HTTPReader
- Read a numeric HTTP status code and return it as a
HTTP.Status
- Overrides:
readStatus
in class HTTPReader
- Returns:
- a symbollic representation of the HTTP status code
- Throws:
java.io.IOException
- upon errors reading from the socket