/** * Returns a reader initialized to read header lines. The reader is configured to expect * ISO-8859-1 encoding, LWS, quoted text and encoded words. Besides reading key:value headers it * will also read and return normal lines as defined in the method above. * * @return a reader to read header lines */ public static HeaderLineReader getHeaderLineReader() { HeaderLineReader hlr = new HeaderLineReader(); hlr.bNameValue = true; hlr.encoding = ENC_ISO8859_1; // hlr.eol hlr.bLWS = true; hlr.bQuotedText = true; hlr.bEncodedWords = true; return hlr; }
/** * Returns a reader initialized to read normal lines. Normal lines being lines with no LWS or * key:value headers. The reader is configured to expect US-ASCII characters. * * @return a reader to read normal lines */ public static HeaderLineReader getLineReader() { HeaderLineReader hlr = new HeaderLineReader(); hlr.bNameValue = false; hlr.encoding = ENC_US_ASCII; return hlr; }