Class HttpClient.ChunkedLineReader
java.lang.Object
one.nio.http.HttpClient.ResponseReader
one.nio.http.HttpClient.ChunkedLineReader
- All Implemented Interfaces:
Closeable, AutoCloseable, Iterator<String>
- Direct Known Subclasses:
HttpClient.ServerSentEventsReader
- Enclosing class:
HttpClient
class HttpClient.ChunkedLineReader
extends HttpClient.ResponseReader
implements Iterator<String>, Closeable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]private intprivate intprivate booleanFields inherited from class HttpClient.ResponseReader
buf, length, pos, socket -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intchunkSizeFor(int cap) voidclose()private intfindLineEnd(byte[] b, int start, int len) booleanhasNext()next()private booleanprivate StringMethods inherited from class HttpClient.ResponseReader
mergeChunks, readBody, readBodyUntilClose, readChunkedBody, readLine, readResponse, readResponseBody, readResponseHeaders, readResultCodeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining, remove
-
Field Details
-
ch
private byte[] ch -
chPos
private int chPos -
chLen
private int chLen -
hasNext
private boolean hasNext
-
-
Constructor Details
-
ChunkedLineReader
ChunkedLineReader(Socket socket, int bufferSize) throws IOException - Throws:
IOException
-
-
Method Details
-
nextChunk
- Throws:
IOExceptionHttpException
-
chunkSizeFor
private int chunkSizeFor(int cap) -
hasNext
-
next
-
readChunkedLine
- Throws:
IOExceptionHttpException
-
findLineEnd
private int findLineEnd(byte[] b, int start, int len) -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-