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 - The stream.
        leaveOpen - if set to true leaves the underlying stream open after disposing.
        Throws:
        com.aspose.ms.System.ArgumentNullException - If given stream is null.
      • 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

      • getBaseStream

        @Deprecated
        public InputStream getBaseStream()
        Deprecated. 

        Gets the base stream.

        Value: The base stream.
      • getCurrentDataSize

        public final long getCurrentDataSize()

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

      • setCurrentDataSize

        protected final 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 final 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.