Package net.i2p.sam
Class ReadLine
java.lang.Object
net.i2p.sam.ReadLine
class ReadLine extends Object
Modified from I2PTunnelHTTPServer
Handles UTF-8. Does not buffer past the end of line.
- Since:
- 0.9.24
-
Constructor Summary
Constructors Constructor Description ReadLine()
-
Method Summary
Modifier and Type Method Description static void
readLine(Socket socket, StringBuilder buf, int timeout)
Read a line teriminated by newline, with a total read timeout.
-
Constructor Details
-
ReadLine
ReadLine()
-
-
Method Details
-
readLine
Read a line teriminated by newline, with a total read timeout. Warning - strips \n but not \r Warning - 8KB line length limit as of 0.7.13, @throws IOException if exceeded- Parameters:
buf
- outputtimeout
- forever if if zero or negative- Throws:
SocketTimeoutException
- if timeout is reached before newlineEOFException
- if EOF is reached before newlinenet.i2p.sam.ReadLine.LineTooLongException
- if too longIOException
- on other errors in the underlying stream
-