Package org.apache.james.mime4j.io

Examples of org.apache.james.mime4j.io.LineReaderInputStream


    }

    private void readRawField() throws IOException, MimeException {
        if (endOfHeader)
            throw new IllegalStateException();
        LineReaderInputStream instream = getDataStream();
        try {
            for (;;) {
                // If there's still data stuck in the line buffer
                // copy it to the field buffer
                int len = linebuf.length();
                if (len > 0) {
                    fieldBuilder.append(linebuf);
                }
                linebuf.clear();
                if (instream.readLine(linebuf) == -1) {
                    monitor(Event.HEADERS_PREMATURE_END);
                    endOfHeader = true;
                    break;
                }
                len = linebuf.length();
View Full Code Here


                field = parsedField != null ? parsedField : rawfield;
                return true;
            } catch (MimeException e) {
                monitor(Event.INVALID_HEADER);
                if (config.isMalformedHeaderStartsBody()) {
                    LineReaderInputStream instream = getDataStream();
                    ByteArrayBuffer buf = fieldBuilder.getRaw();
                    // Complain, if raw data is not available or cannot be 'unread'
                    if (buf == null || !instream.unread(buf)) {
                        throw new MimeParseEventException(Event.INVALID_HEADER);
                    }
                    return false;
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.io.LineReaderInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.