public class HttpStreamWrapper extends StreamImpl
_nullPath, _path
Modifier and Type | Method and Description |
---|---|
boolean |
canRead()
The stream is readable.
|
boolean |
canWrite()
The stream is always writable (?)
|
void |
close()
Close the connection.
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns a header from the response returned from the HTTP server.
|
java.util.Iterator |
getAttributeNames()
Returns an iterator of the returned header names.
|
int |
getAvailable()
Returns the bytes still available.
|
java.lang.String |
getHost()
Returns the stream's host.
|
int |
getPort()
Returns the stream's port.
|
boolean |
isSSL()
Set if this should be an SSL connection.
|
int |
read(byte[] buf,
int offset,
int length)
Read data from the connection.
|
void |
removeAttribute(java.lang.String name)
Remove a header for the request.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets a header for the request.
|
void |
setHead(boolean isHead)
Sets true if we're only interested in the head.
|
void |
setHttp10()
Sets the http version.
|
void |
setHttp11()
Sets the http version.
|
void |
setMethod(java.lang.String method)
Sets the method
|
void |
setSocketTimeout(long timeout)
Sets the timeout.
|
void |
setSSL(boolean isSSL)
Set if this should be an SSL connection.
|
void |
write(byte[] buf,
int offset,
int length,
boolean isEnd)
Writes a buffer to the underlying stream.
|
clearWrite, closeWrite, flush, flushBuffer, flushToDisk, getFlushOnNewline, getNewline, getPath, getReadBuffer, getReadPosition, hasSkip, isClosed, isEof, isMmapEnabled, isSendfileEnabled, readNonBlock, readTimeout, seekEnd, seekStart, setPath, setWriteEncoding, skip, write, writeMmap, writeSendfile
public void setSSL(boolean isSSL)
public boolean isSSL()
public void setMethod(java.lang.String method)
public void setHead(boolean isHead)
public java.lang.String getHost()
public int getPort()
public void setHttp10()
public void setHttp11()
public java.lang.Object getAttribute(java.lang.String name) throws java.io.IOException
getAttribute
in class StreamImpl
name
- name of the headerjava.io.IOException
public java.util.Iterator getAttributeNames() throws java.io.IOException
getAttributeNames
in class StreamImpl
java.io.IOException
public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in class StreamImpl
name
- the attribute name.value
- the attribute value.public void removeAttribute(java.lang.String name)
removeAttribute
in class StreamImpl
name
- the attribute name.public void setSocketTimeout(long timeout) throws java.net.SocketException
java.net.SocketException
public boolean canWrite()
canWrite
in class StreamImpl
public void write(byte[] buf, int offset, int length, boolean isEnd) throws java.io.IOException
write
in class StreamImpl
buffer
- the byte array to write.offset
- the offset into the byte array.length
- the number of bytes to write.isEnd
- true when the write is flushing a close.java.io.IOException
public boolean canRead()
canRead
in class StreamImpl
public int read(byte[] buf, int offset, int length) throws java.io.IOException
read
in class StreamImpl
buf
- byte array receiving the data.offset
- starting offset into the array.length
- number of bytes to read.java.io.IOException
public int getAvailable() throws java.io.IOException
getAvailable
in class StreamImpl
java.io.IOException
public void close() throws java.io.IOException
close
in class StreamImpl
java.io.IOException