Examples of SharedByteArrayInputStream


Examples of javax.mail.util.SharedByteArrayInputStream

import java.util.Properties;

public class MimeMessageFromSharedStreamTest extends MimeMessageFromStreamTest {
   
    protected MimeMessage getMessageFromSources(String sources) throws Exception {
        return new MimeMessage(Session.getDefaultInstance(new Properties()),new SharedByteArrayInputStream(sources.getBytes()));
    }
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

      bos = new ByteArrayOutputStream();
  try {
      strict = source.strict;
      source.writeTo(bos);
      bos.close();
      SharedByteArrayInputStream bis =
          new SharedByteArrayInputStream(bos.toByteArray());
      parse(bis);
      bis.close();
      saved = true;
  } catch (IOException ex) {
      // should never happen, but just in case...
      throw new MessagingException("IOException while copying message",
              ex);
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

     */
    protected InputStream getContentStream() throws MessagingException {
  if (contentStream != null)
      return ((SharedInputStream)contentStream).newStream(0, -1);
  if (content != null)
      return new SharedByteArrayInputStream(content);

  throw new MessagingException("No MimeMessage content");
    }
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

    public SharedByteArrayOutputStream(int size) {
  super(size);
    }

    public InputStream toStream() {
  return new SharedByteArrayInputStream(buf, 0, count);
    }
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

    public MimeMessageObjectMessageSource(ObjectMessage message) throws JMSException {
        this.message = message;
        this.id = message.getJMSMessageID();
        this.content = (byte[]) message.getObject();
        in = new SharedByteArrayInputStream(content);
    }
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

import java.util.Properties;

public class MimeMessageFromSharedStreamTest extends MimeMessageFromStreamTest {
   
    protected MimeMessage getMessageFromSources(String sources) throws Exception {
        return new MimeMessage(Session.getDefaultInstance(new Properties()),new SharedByteArrayInputStream(sources.getBytes()));
    }
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

    String body = "bar\r\n.\r\n";

    protected MimeMessage getMessageFromSources(String sources) throws Exception {
        MimeMessageInputStreamSource mmis = null;
        try {
            mmis = new MimeMessageInputStreamSource("test", new SharedByteArrayInputStream(sources.getBytes()));
        } catch (MessagingException e) {
        }
        return new MimeMessageCopyOnWriteProxy(mmis);
//        return new MimeMessage(Session.getDefaultInstance(new Properties()),new ByteArrayInputStream(sources.getBytes()));
    }
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

        ArrayList recipients = new ArrayList();
        recipients.add(new MailAddress("recipient@test.com"));
        MimeMessageCopyOnWriteProxy mw = new MimeMessageCopyOnWriteProxy(
                new MimeMessageInputStreamSource(
                        "test",
                        new SharedByteArrayInputStream(
                                ("Return-path: return@test.com\r\n"+
                                 "Content-Transfer-Encoding: plain\r\n"+
                                 "Subject: test\r\n\r\n"+
                                 "Body Text\r\n").getBytes())));
       
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

    public LinearProcessorTest(String arg0) throws Exception {
        super(arg0);

        MimeMessageInputStreamSource mmis = null;
        try {
            mmis = new MimeMessageInputStreamSource("test", new SharedByteArrayInputStream((content+sep+body).getBytes()));
        } catch (MessagingException e) {
        }
        mw = new MimeMessageCopyOnWriteProxy(mmis);
        setUp();
  }
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

            else
                bos = new ByteArrayOutputStream();
            try {
                original.writeTo(bos);
                bos.close();
                SharedByteArrayInputStream bis =
                        new SharedByteArrayInputStream(bos.toByteArray());
                parse(bis);
                bis.close();
                saved = true;
            } catch (IOException ex) {
                // should never happen, but just in case...
                throw new MessagingException("IOException while copying message",
                                ex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.