Examples of SharedByteArrayInputStream


Examples of javax.mail.util.SharedByteArrayInputStream

                List<Message<Long>> messages = new ArrayList<Message<Long>>();
                long i = start;
                while (i < calcEnd) {
                    long uid = i;
                    SimpleMessage<Long> m = new SimpleMessage<Long>(null, 0, 0, new SharedByteArrayInputStream(
                            "".getBytes()), new Flags(), new PropertyBuilder(), 1L);
                    m.setUid(uid);
                    messages.add(m);
                    i++;
                }
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 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

     * @return a <code>BufferedInputStream</code> containing the data
     */
    public synchronized InputStream getInputStream() throws IOException {
        InputStream in;
        if (out.isInMemory()) {
            in = new SharedByteArrayInputStream(out.getData());
        } else {
            in = new SharedFileInputStream(out.getFile());
        }
        streams.add(in);
        return in;
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

                    } else {
                        bos = new ByteArrayOutputStream();
                    }
                    original.writeTo(bos);
                    bos.close();
                    in = new SharedByteArrayInputStream(bos.toByteArray());
                    parse(in);
                    in.close();
                    saved = true;
                } else {
                    MimeMessageInputStreamSource src = new MimeMessageInputStreamSource("MailCopy-" + UUID.randomUUID().toString());
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

    public void setUp() throws Exception {

        mailRepository = getMailRepository();
        MimeMessageInputStreamSource mmis = null;
        try {
            mmis = new MimeMessageInputStreamSource("test", new SharedByteArrayInputStream((content + sep + body).
                    getBytes()));
        } catch (MessagingException e) {
        }
        mimeMessage = new MimeMessageCopyOnWriteProxy(mmis);
        Collection<MailAddress> recipients = new ArrayList<MailAddress>();
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

  {   
    flush();
    if (this.thresholdReached)
      return new SharedTmpFileInputStream(this.outFile);
    else
      return new SharedByteArrayInputStream(this.buffer.array());
  }
View Full Code Here

Examples of javax.mail.util.SharedByteArrayInputStream

    @Override
    protected MimeMessage getMessageFromSources(String sources) throws Exception {
        MimeMessageInputStreamSource mmis = null;
        try {
            mmis = new MimeMessageInputStreamSource("test", new SharedByteArrayInputStream(sources.getBytes()));
        } catch (MessagingException e) {
        }
        return new TestableMimeMessageWrapper(mmis);
    }
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.