Package com.wowza.io
Class HTTPByteReader
- Object
- 
- com.wowza.io.HTTPByteReader
 
- 
- Direct Known Subclasses:
- HTTPByteReaderS3
 
 public class HTTPByteReader extends Object
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classHTTPByteReader.SendResult
 - 
Field SummaryFields Modifier and Type Field Description static intBUFFERINCSIZEprotected intconnectionTimeoutstatic StringCRLFprotected org.apache.commons.lang.time.FastDateFormatdateFormatprotected java.util.List<String>debugInfoprotected StringdebugPrefixstatic intHEADINDEX_CONTENTLENGTHstatic intHEADINDEX_LASTMODIFIEDstatic intHEADINDEX_SIZEstatic intHEADINDEX_STATUSprotected Stringhoststatic intMAXHEADERSIZEprotected intmaxRetriesprotected intmaxUsesBeforeReconnectprotected StringBuffermsgBufprotected String[]parseDateFormatsprotected intportprotected StringproxyHostprotected intproxyPortprotected intreadTimeoutprotected intreceiveBufferSizestatic intRECEIVEBUFFERSIZEprotected StringreqPathprotected booleanrequestFullURLprotected intsendBufferSizestatic intSENDBUFFERSIZEprotected java.net.Socketsocketstatic intTIMEOUTprotected StringuserAgentprotected intuses
 - 
Constructor SummaryConstructors Constructor Description HTTPByteReader(String host, int port)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidconnect()HTTPByteReaderResultdelete(String path)HTTPByteReaderResultdeleteDirect(String path)protected voiddumpDebug()protected StringgetConextPath()intgetConnectionTimeout()protected voidgetDeleteCommand(String path)protected voidgetGetCommand(String path, long pos, int flen)protected voidgetHeadCommand(String path)intgetMaxRetries()intgetMaxUsesBeforeReconnect()protected voidgetPostCommand(String path, PacketFragmentList fragmentList)intgetReadTimeout()intgetReceiveBufferSize()protected StringgetRequestPath(String path, String host, int port)intgetSendBufferSize()StringgetUserAgent()long[]head(String path)booleanisOpen()booleanisRequestFullURL()protected voidparseHeader(HTTPByteReader.SendResult result, byte[] buffer, int offset, int len, boolean isHead)HTTPByteReaderResultread(String path, long pos, int flen)HTTPByteReaderResultreadDirect(String path, long pos, int flen)protected voidreconnect()HTTPByteReader.SendResultsendRequest(byte[] request, boolean isHead)HTTPByteReader.SendResultsendRequest(byte[] request, int len, boolean isHead)HTTPByteReader.SendResultsendRequest(byte[] request, PacketFragmentList fragmentList, int len, boolean isHead)voidsetConnectionTimeout(int connectionTimeout)voidsetMaxRetries(int maxRetries)voidsetMaxUsesBeforeReconnect(int maxUsesBeforeReconnect)voidsetProxyAddress(String host, int port)voidsetReadTimeout(int readTimeout)voidsetReceiveBufferSize(int receiveBufferSize)voidsetRequestFullURL(boolean requestFullURL)voidsetSendBufferSize(int sendBufferSize)voidsetUserAgent(String userAgent)HTTPByteReaderResultwrite(String path, byte[] buffer, int offset, int len)HTTPByteReaderResultwrite(String path, PacketFragmentList fragmentList)HTTPByteReaderResultwrite(String path, String str)HTTPByteReaderResultwriteDirect(String path, PacketFragmentList fragmentList)
 
- 
- 
- 
Field Detail- 
MAXHEADERSIZEpublic static final int MAXHEADERSIZE - See Also:
- Constant Field Values
 
 - 
BUFFERINCSIZEpublic static final int BUFFERINCSIZE - See Also:
- Constant Field Values
 
 - 
TIMEOUTpublic static final int TIMEOUT - See Also:
- Constant Field Values
 
 - 
SENDBUFFERSIZEpublic static final int SENDBUFFERSIZE - See Also:
- Constant Field Values
 
 - 
RECEIVEBUFFERSIZEpublic static final int RECEIVEBUFFERSIZE - See Also:
- Constant Field Values
 
 - 
CRLFpublic static final String CRLF - See Also:
- Constant Field Values
 
 - 
HEADINDEX_STATUSpublic static final int HEADINDEX_STATUS - See Also:
- Constant Field Values
 
 - 
HEADINDEX_CONTENTLENGTHpublic static final int HEADINDEX_CONTENTLENGTH - See Also:
- Constant Field Values
 
 - 
HEADINDEX_LASTMODIFIEDpublic static final int HEADINDEX_LASTMODIFIED - See Also:
- Constant Field Values
 
 - 
HEADINDEX_SIZEpublic static final int HEADINDEX_SIZE - See Also:
- Constant Field Values
 
 - 
hostprotected String host 
 - 
portprotected int port 
 - 
reqPathprotected String reqPath 
 - 
proxyHostprotected String proxyHost 
 - 
proxyPortprotected int proxyPort 
 - 
dateFormatprotected org.apache.commons.lang.time.FastDateFormat dateFormat 
 - 
socketprotected java.net.Socket socket 
 - 
msgBufprotected StringBuffer msgBuf 
 - 
maxRetriesprotected int maxRetries 
 - 
maxUsesBeforeReconnectprotected int maxUsesBeforeReconnect 
 - 
usesprotected int uses 
 - 
readTimeoutprotected int readTimeout 
 - 
connectionTimeoutprotected int connectionTimeout 
 - 
debugInfoprotected java.util.List<String> debugInfo 
 - 
debugPrefixprotected String debugPrefix 
 - 
requestFullURLprotected boolean requestFullURL 
 - 
parseDateFormatsprotected String[] parseDateFormats 
 - 
sendBufferSizeprotected int sendBufferSize 
 - 
receiveBufferSizeprotected int receiveBufferSize 
 - 
userAgentprotected String userAgent 
 
- 
 - 
Method Detail- 
setProxyAddresspublic void setProxyAddress(String host, int port)
 - 
closepublic void close() 
 - 
connectpublic void connect() 
 - 
reconnectprotected void reconnect() 
 - 
isOpenpublic boolean isOpen() 
 - 
parseHeaderprotected void parseHeader(HTTPByteReader.SendResult result, byte[] buffer, int offset, int len, boolean isHead) 
 - 
readpublic HTTPByteReaderResult read(String path, long pos, int flen) 
 - 
deletepublic HTTPByteReaderResult delete(String path) 
 - 
getDeleteCommandprotected void getDeleteCommand(String path) 
 - 
deleteDirectpublic HTTPByteReaderResult deleteDirect(String path) 
 - 
writepublic HTTPByteReaderResult write(String path, String str) 
 - 
writepublic HTTPByteReaderResult write(String path, byte[] buffer, int offset, int len) 
 - 
writepublic HTTPByteReaderResult write(String path, PacketFragmentList fragmentList) 
 - 
getPostCommandprotected void getPostCommand(String path, PacketFragmentList fragmentList)
 - 
writeDirectpublic HTTPByteReaderResult writeDirect(String path, PacketFragmentList fragmentList) 
 - 
getRequestPathprotected String getRequestPath(String path, String host, int port)
 - 
getConextPathprotected String getConextPath() 
 - 
getHeadCommandprotected void getHeadCommand(String path) 
 - 
headpublic long[] head(String path) 
 - 
getGetCommandprotected void getGetCommand(String path, long pos, int flen)
 - 
readDirectpublic HTTPByteReaderResult readDirect(String path, long pos, int flen) 
 - 
dumpDebugprotected void dumpDebug() 
 - 
sendRequestpublic HTTPByteReader.SendResult sendRequest(byte[] request, boolean isHead) 
 - 
sendRequestpublic HTTPByteReader.SendResult sendRequest(byte[] request, int len, boolean isHead) 
 - 
sendRequestpublic HTTPByteReader.SendResult sendRequest(byte[] request, PacketFragmentList fragmentList, int len, boolean isHead) 
 - 
getMaxUsesBeforeReconnectpublic int getMaxUsesBeforeReconnect() 
 - 
setMaxUsesBeforeReconnectpublic void setMaxUsesBeforeReconnect(int maxUsesBeforeReconnect) 
 - 
getMaxRetriespublic int getMaxRetries() 
 - 
setMaxRetriespublic void setMaxRetries(int maxRetries) 
 - 
getReadTimeoutpublic int getReadTimeout() 
 - 
setReadTimeoutpublic void setReadTimeout(int readTimeout) 
 - 
isRequestFullURLpublic boolean isRequestFullURL() 
 - 
setRequestFullURLpublic void setRequestFullURL(boolean requestFullURL) 
 - 
getConnectionTimeoutpublic int getConnectionTimeout() 
 - 
setConnectionTimeoutpublic void setConnectionTimeout(int connectionTimeout) 
 - 
getSendBufferSizepublic int getSendBufferSize() 
 - 
setSendBufferSizepublic void setSendBufferSize(int sendBufferSize) 
 - 
getReceiveBufferSizepublic int getReceiveBufferSize() 
 - 
setReceiveBufferSizepublic void setReceiveBufferSize(int receiveBufferSize) 
 - 
getUserAgentpublic String getUserAgent() 
 - 
setUserAgentpublic void setUserAgent(String userAgent) 
 
- 
 
-