Package one.nio.http
Class HttpClient.ChunkedLineReader
- java.lang.Object
-
- one.nio.http.HttpClient.ResponseReader
-
- one.nio.http.HttpClient.ChunkedLineReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.util.Iterator<java.lang.String>
- Direct Known Subclasses:
HttpClient.ServerSentEventsReader
- Enclosing class:
- HttpClient
class HttpClient.ChunkedLineReader extends HttpClient.ResponseReader implements java.util.Iterator<java.lang.String>, java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description ChunkedLineReader(Socket socket, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intchunkSizeFor(int cap)voidclose()private intfindLineEnd(byte[] b, int start, int len)booleanhasNext()java.lang.Stringnext()private booleannextChunk()private java.lang.StringreadChunkedLine()-
Methods inherited from class one.nio.http.HttpClient.ResponseReader
mergeChunks, readBody, readBodyUntilClose, readChunkedBody, readLine, readResponse, readResponseBody, readResponseHeaders, readResultCode
-
-
-
-
Constructor Detail
-
ChunkedLineReader
ChunkedLineReader(Socket socket, int bufferSize) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
nextChunk
private boolean nextChunk() throws java.io.IOException, HttpException- Throws:
java.io.IOExceptionHttpException
-
chunkSizeFor
private int chunkSizeFor(int cap)
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<java.lang.String>
-
next
public java.lang.String next()
- Specified by:
nextin interfacejava.util.Iterator<java.lang.String>
-
readChunkedLine
private java.lang.String readChunkedLine() throws java.io.IOException, HttpException- Throws:
java.io.IOExceptionHttpException
-
findLineEnd
private int findLineEnd(byte[] b, int start, int len)
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-