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.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReadLine()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `readLine(Socket socket, StringBuilder buf, int timeout)` Read a line terminated by newline, with a total read timeout.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ReadLine

          ReadLine()

  - ### Method Detail

    - #### readLine

          public static void readLine(Socket socket,
                                      StringBuilder buf,
                                      int timeout)
                               throws IOException

      Read a line terminated 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` - output
        `timeout` - forever if if zero or negative
      Throws:
        `SocketTimeoutException` - if timeout is reached before newline
        `EOFException` - if EOF is reached before newline
        `LineTooLongException` - if too long
        `IOException` - on other errors in the underlying stream