@Test public void streamWith1MBytesShouldBeReadable() throws MessagingException, IOException { testee = new MimeMessageInputStreamSource("myKey", new ZeroedInputStream(_1M)); assertThat(testee.getInputStream()).hasSameContentAs(new ZeroedInputStream(_1M)); }
@Override 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; }
MimeMessageInputStreamSource extends MimeMessageSource implements Disposable { @Override 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; } }
MimeMessageInputStreamSource extends MimeMessageSource implements Disposable { @Override 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; } MimeMessageInputStreamSource(String key, InputStream in);  MimeMessageInputStreamSource(String key); }
MimeMessageInputStreamSource extends MimeMessageSource implements Disposable { @Override 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; } MimeMessageInputStreamSource(String key, InputStream in);  MimeMessageInputStreamSource(String key); @Override String getSourceId(); @Override synchronized InputStream getInputStream(); @Override long getMessageSize(); OutputStream getWritableOutputStream(); @Override void dispose(); }
MimeMessageInputStreamSource extends MimeMessageSource implements Disposable { @Override 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; } MimeMessageInputStreamSource(String key, InputStream in);  MimeMessageInputStreamSource(String key); @Override String getSourceId(); @Override synchronized InputStream getInputStream(); @Override long getMessageSize(); OutputStream getWritableOutputStream(); @Override void dispose();  }