Class DeferredFileMailData

  • All Implemented Interfaces:
    MailData

    public class DeferredFileMailData
    extends Object
    implements MailData
    DeferredFileMailData stores message content in memory if it is short or in a temporary file if it is long.
    • Constructor Summary

      Constructors 
      Constructor Description
      DeferredFileMailData​(org.subethamail.smtp.io.DeferredFileOutputStream deferredFileOutputStream)
      Constructs a new DeferredFileMailData so that it contains the message content residing in the specified stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Releases resources, like temporary files.
      java.io.InputStream getInputStream()
      Returns the data stream positioned to the first byte of the mail data.
      void writeTo​(java.io.OutputStream out)
      Copies the message content into the supplied stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeferredFileMailData

        public DeferredFileMailData​(org.subethamail.smtp.io.DeferredFileOutputStream deferredFileOutputStream)
        Constructs a new DeferredFileMailData so that it contains the message content residing in the specified stream.
        Parameters:
        deferredFileOutputStream - The stream containing the message content.
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
        Description copied from interface: MailData
        Returns the data stream positioned to the first byte of the mail data. The caller must close the returned stream.
        Specified by:
        getInputStream in interface MailData
      • writeTo

        public void writeTo​(java.io.OutputStream out)
                     throws java.io.IOException
        Description copied from interface: MailData
        Copies the message content into the supplied stream. It does not close the target stream.
        Specified by:
        writeTo in interface MailData
        Throws:
        java.io.IOException
      • dispose

        public void dispose()
        Description copied from interface: MailData
        Releases resources, like temporary files.
        Specified by:
        dispose in interface MailData