public MemoryTextBody(InputStream is, String mimeCharset) throws IOException {

    this.mimeCharset = mimeCharset;

    TempPath tempPath = TempStorage.getInstance().getRootTempPath();

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    IOUtils.copy(is, out);
    out.close();
    tempFile = out.toByteArray();
  }
示例#2
0
 public TempFileTextBody(InputStream var1, String var2) throws IOException {
   this.mimeCharset = null;
   this.tempFile = null;
   this.mimeCharset = var2;
   TempFile var3 =
       TempStorage.getInstance().getRootTempPath().createTempFile("attachment", ".txt");
   this.tempFile = var3;
   OutputStream var4 = this.tempFile.getOutputStream();
   IOUtils.copy(var1, var4);
   var4.close();
 }