public class HTTPInputStreamReader extends Object
| Constructor and Description |
|---|
HTTPInputStreamReader(HTTPConnectionHelper httpConnectionHelper,
UploadPolicy uploadPolicy)
The standard constructor: does nothing !
|
| Modifier and Type | Method and Description |
|---|---|
int |
gethttpStatusCode()
Return the last read http response (200, in case of success).
|
String |
getResponseBody()
Get the last response bytearrayResponseBody.
|
byte[] |
getResponseBodyAsByteArray()
Get the last response bytearrayResponseBody.
|
String |
getResponseCharset()
Get the charset that should be used to decode the last response, when
using the
getResponseBodyAsByteArray() method. |
String |
getResponseHeaders()
Get the headers of the HTTP response.
|
String |
getResponseMsg()
Get the last response message.
|
int |
readHttpResponse()
The main method: reads the response in the input stream.
|
static byte[] |
readLine(PushbackInputStream inputStream,
boolean includeCR)
Similar like BufferedInputStream#readLine() but operates on raw bytes.
|
static String |
readLine(PushbackInputStream inputStream,
String charset,
boolean includeCR)
Similar like BufferedInputStream#readLine() but operates on raw bytes.
|
public HTTPInputStreamReader(HTTPConnectionHelper httpConnectionHelper, UploadPolicy uploadPolicy)
httpConnectionHelper - The connection helper, associated with this
instance.uploadPolicy - The current upload policy.public int gethttpStatusCode()
public String getResponseBody()
public byte[] getResponseBodyAsByteArray()
getResponseCharset().public String getResponseCharset()
getResponseBodyAsByteArray() method.public String getResponseHeaders()
public String getResponseMsg()
public int readHttpResponse()
throws JUploadException
JUploadExceptionpublic static String readLine(PushbackInputStream inputStream, String charset, boolean includeCR) throws IOException, JUploadException
inputStream - charset - The input charset of the stream.includeCR - Set to true, if the terminating CR/LF should be included
in the returned byte array.IOExceptionJUploadExceptionpublic static byte[] readLine(PushbackInputStream inputStream, boolean includeCR) throws IOException, JUploadException
inputStream - includeCR - Set to true, if the terminating CR/LF should be included
in the returned byte array. In this case, CR/LF is always
returned to the caller, whether the input stream got CR, LF or
CRLF.IOExceptionJUploadExceptionCopyright © 2015. All rights reserved.