com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class MboxStorageReader

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable
    Direct Known Subclasses:
    MboxrdStorageReader


    public abstract class MboxStorageReader
    extends Object
    implements com.aspose.ms.System.IDisposable

    A base class for any mbox-based mail storage reader.

    • Constructor Detail

      • MboxStorageReader

        protected MboxStorageReader(InputStream stream,
                         boolean leaveOpen)

        Initializes a new instance of the MboxStorageReader class.

        Parameters:
        stream - A base stream
        leaveOpen - if set to true leaves the underlying stream open after disposing.
      • MboxStorageReader

        protected MboxStorageReader(String fileName,
                         boolean leaveOpen)

        Initializes a new instance of the MboxStorageReader class.

        Parameters:
        fileName - Name of the file.
        leaveOpen - if set to true leaves the underlying stream open after disposing.
        Throws:
        com.aspose.ms.System.ArgumentNullException - If filename is null or empty.
    • Method Detail

      • getCurrentDataSize

        public long getCurrentDataSize()

        Gets the number of bytes that is read by ReadNextMessage method.

      • setCurrentDataSize

        protected void setCurrentDataSize(long value)

        Gets the number of bytes that is read by ReadNextMessage method.

      • readNextMessage

        public abstract MailMessage readNextMessage()

        Reads the next message from underlying storage stream.

        Returns:
        A MailMessage object if it can be read or <b>null</b> if no more messages are available.
      • readNextMessage

        public abstract MailMessage readNextMessage(String[] fromMarker)

        Reads the next message from underlying storage stream.

        Parameters:
        fromMarker - Gets the From Marker while parsing the MBox Storage file.
        Returns:
        A MailMessage object if it can be read or <b>null</b> if no more messages are available.
      • dispose

        public void dispose()

        Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable
      • dispose

        protected void dispose(boolean disposing)

        Releases unmanaged and - optionally - managed resources

        Parameters:
        disposing - true to release both managed and unmanaged resources; false to release only unmanaged resources.