Package one.nio.http
Class HttpClient.ResponseReader
- java.lang.Object
-
- one.nio.http.HttpClient.ResponseReader
-
- Direct Known Subclasses:
HttpClient.ChunkedLineReader
- Enclosing class:
- HttpClient
static class HttpClient.ResponseReader extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ResponseReader(Socket socket, int bufferSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static booleanmayHaveBody(int status)(package private) byte[]mergeChunks(java.util.List<byte[]> chunks)(package private) byte[]readBody(int contentLength)(package private) byte[]readBodyUntilClose()(package private) byte[]readChunkedBody()(package private) java.lang.StringreadLine()(package private) ResponsereadResponse(int method)(package private) voidreadResponseBody(int method, Response response)(package private) voidreadResponseHeaders(Response response)(package private) java.lang.StringreadResultCode()
-
-
-
Field Detail
-
socket
Socket socket
-
buf
byte[] buf
-
length
int length
-
pos
int pos
-
-
Constructor Detail
-
ResponseReader
ResponseReader(Socket socket, int bufferSize) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
readResponse
Response readResponse(int method) throws java.io.IOException, HttpException
- Throws:
java.io.IOExceptionHttpException
-
readResultCode
java.lang.String readResultCode() throws java.io.IOException, HttpException- Throws:
java.io.IOExceptionHttpException
-
readResponseHeaders
void readResponseHeaders(Response response) throws java.io.IOException, HttpException
- Throws:
java.io.IOExceptionHttpException
-
readResponseBody
void readResponseBody(int method, Response response) throws java.io.IOException, HttpException- Throws:
java.io.IOExceptionHttpException
-
readLine
java.lang.String readLine() throws java.io.IOException, HttpException- Throws:
java.io.IOExceptionHttpException
-
readChunkedBody
byte[] readChunkedBody() throws java.io.IOException, HttpException- Throws:
java.io.IOExceptionHttpException
-
readBody
byte[] readBody(int contentLength) throws java.io.IOException- Throws:
java.io.IOException
-
readBodyUntilClose
byte[] readBodyUntilClose() throws java.io.IOException- Throws:
java.io.IOException
-
mergeChunks
byte[] mergeChunks(java.util.List<byte[]> chunks)
-
mayHaveBody
private static boolean mayHaveBody(int status)
-
-