Package org.apache.james.mime4j.io

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


    private void testConvertBoth(String s1, String s2) throws IOException {
        byte[] bytes = new byte[1024];
       
        ByteArrayInputStream bais = new ByteArrayInputStream(fromString(s1));
        EOLConvertingInputStream in =
            new EOLConvertingInputStream(bais,
                        EOLConvertingInputStream.CONVERT_BOTH);
        int n = in.read(bytes);
        assertEquals(s2, toString(bytes, n));
    }
View Full Code Here


   
    private void testConvertCR(String s1, String s2) throws IOException {
        byte[] bytes = new byte[1024];
       
        ByteArrayInputStream bais = new ByteArrayInputStream(fromString(s1));
        EOLConvertingInputStream in =
            new EOLConvertingInputStream(bais,
                        EOLConvertingInputStream.CONVERT_CR);
        int n = in.read(bytes);
        assertEquals(s2, toString(bytes, n));
    }
View Full Code Here

   
    private void testConvertLF(String s1, String s2) throws IOException {
        byte[] bytes = new byte[1024];
       
        ByteArrayInputStream bais = new ByteArrayInputStream(fromString(s1));
        EOLConvertingInputStream in =
            new EOLConvertingInputStream(bais,
                        EOLConvertingInputStream.CONVERT_LF);
        int n = in.read(bytes);
        assertEquals(s2, toString(bytes, n));
    }
View Full Code Here

    private void testConvertBoth(String s1, String s2) throws IOException {
        byte[] bytes = new byte[1024];

        ByteArrayInputStream bais = new ByteArrayInputStream(fromString(s1));
        EOLConvertingInputStream in =
            new EOLConvertingInputStream(bais,
                        EOLConvertingInputStream.CONVERT_BOTH);
        int n = in.read(bytes);
        assertEquals(s2, toString(bytes, n));
    }
View Full Code Here

    private void testConvertCR(String s1, String s2) throws IOException {
        byte[] bytes = new byte[1024];

        ByteArrayInputStream bais = new ByteArrayInputStream(fromString(s1));
        EOLConvertingInputStream in =
            new EOLConvertingInputStream(bais,
                        EOLConvertingInputStream.CONVERT_CR);
        int n = in.read(bytes);
        assertEquals(s2, toString(bytes, n));
    }
View Full Code Here

    private void testConvertLF(String s1, String s2) throws IOException {
        byte[] bytes = new byte[1024];

        ByteArrayInputStream bais = new ByteArrayInputStream(fromString(s1));
        EOLConvertingInputStream in =
            new EOLConvertingInputStream(bais,
                        EOLConvertingInputStream.CONVERT_LF);
        int n = in.read(bytes);
        assertEquals(s2, toString(bytes, n));
    }
View Full Code Here

     * @throws MimeIOException
     *                 on MIME protocol violations.
     */
    public Message(InputStream is) throws IOException, MimeException {
        MessageBuilder mb = newMessageBuilder().newMessageBuilder();
        org.apache.james.mime4j.dom.Message mImpl = mb.parseMessage(new EOLConvertingInputStream(is));
       
        this.message = mImpl;
    }
View Full Code Here

                    String mediaType = stream.getBodyDescriptor().getMimeType() + "; charset=" + stream.getBodyDescriptor().getCharset();

                    // oftwewel: gebruik getDecodedInputStream
                    InputStream bodyDataStream;
                    if (MimeUtil.isQuotedPrintableEncoded(stream.getBodyDescriptor().getTransferEncoding())) {
                        bodyDataStream = new QuotedPrintableInputStream(new EOLConvertingInputStream(stream.getInputStream(), EOLConvertingInputStream.CONVERT_LF));
                    } else if (MimeUtil.isBase64Encoding(stream.getBodyDescriptor().getTransferEncoding())) {
                        bodyDataStream = new Base64InputStream(stream.getInputStream());
                    } else {
                        bodyDataStream = stream.getInputStream();
                    }
View Full Code Here

    private void testConvertBoth(String s1, String s2) throws IOException {
        byte[] bytes = new byte[1024];
       
        ByteArrayInputStream bais = new ByteArrayInputStream(fromString(s1));
        EOLConvertingInputStream in =
            new EOLConvertingInputStream(bais,
                        EOLConvertingInputStream.CONVERT_BOTH);
        int n = in.read(bytes);
        assertEquals(s2, toString(bytes, n));
    }
View Full Code Here

   
    private void testConvertCR(String s1, String s2) throws IOException {
        byte[] bytes = new byte[1024];
       
        ByteArrayInputStream bais = new ByteArrayInputStream(fromString(s1));
        EOLConvertingInputStream in =
            new EOLConvertingInputStream(bais,
                        EOLConvertingInputStream.CONVERT_CR);
        int n = in.read(bytes);
        assertEquals(s2, toString(bytes, n));
    }
View Full Code Here

TOP

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

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.