in core/src/main/java/org/apache/james/mime4j/stream/RawFieldParser.java [193:220]
public String parseValue(final ByteSequence buf, final ParserCursor cursor, final BitSet delimiters) {
StringBuilder dst = new StringBuilder();
boolean whitespace = false;
while (!cursor.atEnd()) {
char current = (char) (buf.byteAt(cursor.getPos()) & 0xff);
if (delimiters != null && delimiters.get(current)) {
break;
} else if (CharsetUtil.isWhitespace(current)) {
skipWhiteSpace(buf, cursor);
whitespace = true;
} else if (current == '(') {
skipComment(buf, cursor);
} else if (current == '\"') {
if (dst.length() > 0 && whitespace) {
dst.append(' ');
}
copyQuotedContent(buf, cursor, dst);
whitespace = false;
} else {
if (dst.length() > 0 && whitespace) {
dst.append(' ');
}
copyUnquotedContent(buf, cursor, delimiters, dst);
whitespace = false;
}
}
return dst.toString();
}