code: private int parseEndOfLine(String headerPart, int end) {
          int index = end;
          for (; ;) {
              int offset = headerPart.indexOf('\r', index);
              if (offset == -1 || offset + 1 >= headerPart.length()) {
                  throw new IllegalStateException("Expected headers to be terminated by an empty line.");
              }
              if (headerPart.charAt(offset + 1) == '\n') {
                  return offset;
              }
              index = offset + 1;
          }
      }
docs: Skips bytes until the end of the current line.
  
  @param headerPart The headers, which are being parsed.
  @param end        Index of the last byte, which has yet been processed.
  @return Index of the \r\n sequence, which indicates end of line.