// Path: src/org/httpkit/HttpUtils.java
// public static final byte CR = 13; // \r
// 
// Path: src/org/httpkit/HttpUtils.java
// public static final byte LF = 10; // \n


import java.nio.ByteBuffer;
import java.util.Arrays;
import static org.httpkit.HttpUtils.CR;
import static org.httpkit.HttpUtils.LF;
package org.httpkit;



public class LineReader {
    // 1k buffer, increase as necessary;
    byte[] lineBuffer = new byte[1024];
    int lineBufferIdx = 0;
    private final int maxLine;

    public LineReader(int maxLine) {
        this.maxLine = maxLine;
    }

    public String readLine(ByteBuffer buffer) throws LineTooLargeException {
        byte b;
        boolean more = true;
        while (buffer.hasRemaining() && more) {
            b = buffer.get();
            if (b == CR) {
// Path: src/org/httpkit/HttpUtils.java
// public static final byte CR = 13; // \r
// 
// Path: src/org/httpkit/HttpUtils.java
// public static final byte LF = 10; // \n


// Path: src/org/httpkit/LineReader.java
import java.nio.ByteBuffer;
import java.util.Arrays;
import static org.httpkit.HttpUtils.CR;
import static org.httpkit.HttpUtils.LF;

package org.httpkit;



public class LineReader {
    // 1k buffer, increase as necessary;
    byte[] lineBuffer = new byte[1024];
    int lineBufferIdx = 0;
    private final int maxLine;

    public LineReader(int maxLine) {
        this.maxLine = maxLine;
    }

    public String readLine(ByteBuffer buffer) throws LineTooLargeException {
        byte b;
        boolean more = true;
        while (buffer.hasRemaining() && more) {
            b = buffer.get();
            if (b == CR) {
                if (buffer.hasRemaining() && buffer.get() == LF) {