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, writeSendfilepublic 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 StreamImplname - name of the headerjava.io.IOExceptionpublic java.util.Iterator getAttributeNames()
throws java.io.IOException
getAttributeNames in class StreamImpljava.io.IOExceptionpublic void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in class StreamImplname - the attribute name.value - the attribute value.public void removeAttribute(java.lang.String name)
removeAttribute in class StreamImplname - the attribute name.public void setSocketTimeout(long timeout)
throws java.net.SocketException
java.net.SocketExceptionpublic boolean canWrite()
canWrite in class StreamImplpublic void write(byte[] buf,
int offset,
int length,
boolean isEnd)
throws java.io.IOException
write in class StreamImplbuffer - 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.IOExceptionpublic boolean canRead()
canRead in class StreamImplpublic int read(byte[] buf,
int offset,
int length)
throws java.io.IOException
read in class StreamImplbuf - byte array receiving the data.offset - starting offset into the array.length - number of bytes to read.java.io.IOExceptionpublic int getAvailable()
throws java.io.IOException
getAvailable in class StreamImpljava.io.IOExceptionpublic void close()
throws java.io.IOException
close in class StreamImpljava.io.IOException