public abstract class MboxStorageReader extends Object implements com.aspose.ms.System.IDisposable, Closeable
A base class for any mbox-based mail storage reader.
| Modifier and Type | Field and Description |
|---|---|
protected static byte[] |
EmptyFromMarkerCR |
protected static byte[] |
EmptyFromMarkerCRLF |
protected static byte[] |
EmptyFromMarkerLF |
protected static byte[] |
FromMarker
"From " signature, indicates a start of the message.
|
protected static byte[] |
MboxoMarker
The mbox format uses a single blank line followed by the string 'From ' (with a space) to delimit messages.
|
protected com.aspose.ms.System.Text.Encoding |
preferredTextEncoding |
| Modifier | Constructor and Description |
|---|---|
protected |
MboxStorageReader(InputStream stream,
boolean leaveOpen)
Deprecated.
This ctor is obsolete and will be removed soon. Please use ctor with MboxLoadOptions
|
protected |
MboxStorageReader(InputStream stream,
MboxLoadOptions options)
Initializes a new instance of the
MboxStorageReader class. |
protected |
MboxStorageReader(com.aspose.ms.System.IO.Stream stream,
boolean leaveOpen)
Deprecated.
This ctor is obsolete and will be removed soon. Please use ctor with MboxLoadOptions
|
protected |
MboxStorageReader(com.aspose.ms.System.IO.Stream stream,
MboxLoadOptions options)
Initializes a new instance of the
MboxStorageReader class. |
protected |
MboxStorageReader(String fileName,
boolean leaveOpen)
Deprecated.
This ctor is obsolete and will be removed soon. Please use ctor with MboxLoadOptions
|
protected |
MboxStorageReader(String fileName,
MboxLoadOptions options)
Initializes a new instance of the
MboxStorageReader class. |
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
byteArrayStartsFromMarker(byte[] array,
byte[] marker)
Checks whether the array starts from given marker.
|
void |
close() |
static MboxStorageReader |
createReader(InputStream stream,
boolean leaveOpen)
Deprecated.
This method is obsolete and will be removed soon. Please use method with MboxLoadOptions
|
static MboxStorageReader |
createReader(InputStream stream,
MboxLoadOptions options)
Creates the instance of reader.
|
static MboxStorageReader |
createReader(com.aspose.ms.System.IO.Stream stream,
boolean leaveOpen)
Deprecated.
This method is obsolete and will be removed soon. Please use method with MboxLoadOptions
|
static MboxStorageReader |
createReader(com.aspose.ms.System.IO.Stream stream,
MboxLoadOptions options)
Creates the instance of reader.
|
static MboxStorageReader |
createReader(String fileName,
boolean leaveOpen)
Deprecated.
This method is obsolete and will be removed soon. Please use method with MboxLoadOptions
|
static MboxStorageReader |
createReader(String fileName,
MboxLoadOptions options)
Creates the instance of reader.
|
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
protected void |
dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MailMessage> |
enumerateMessages()
Exposes the enumerator, which supports an iteration of messages in storage.
|
long |
getCurrentDataSize()
Gets the number of bytes that is read by ReadNextMessage method.
|
abstract int |
getTotalItemsCount()
Returns the number of messages in a storage.
|
protected static byte[] |
readLine(com.aspose.ms.System.IO.Stream stream)
Reads the line from stream.
|
abstract MailMessage |
readNextMessage()
Reads the next message from underlying storage stream.
|
abstract MailMessage |
readNextMessage(String[] fromMarker)
Reads the next message from underlying storage stream.
|
protected void |
setCurrentDataSize(long value)
Gets the number of bytes that is read by ReadNextMessage method.
|
protected final com.aspose.ms.System.Text.Encoding preferredTextEncoding
protected static final byte[] FromMarker
"From " signature, indicates a start of the message.
protected static final byte[] EmptyFromMarkerCRLF
protected static final byte[] EmptyFromMarkerCR
protected static final byte[] EmptyFromMarkerLF
protected static final byte[] MboxoMarker
The mbox format uses a single blank line followed by the string 'From ' (with a space) to delimit messages. In mboxo format sender's email address in message delimiter is replaced by the constant string '???@???', i.e. 'From ???@???'
@Deprecated protected MboxStorageReader(InputStream stream, boolean leaveOpen)
Initializes a new instance of the MboxStorageReader class.
stream - The stream.leaveOpen - if set to true leaves the underlying stream open after disposing.com.aspose.ms.System.ArgumentNullException - If given stream is null.@Deprecated protected MboxStorageReader(com.aspose.ms.System.IO.Stream stream, boolean leaveOpen)
Initializes a new instance of the MboxStorageReader class.
stream - The stream.leaveOpen - if set to true leaves the underlying stream open after disposing.com.aspose.ms.System.ArgumentNullException - If given stream is null.@Deprecated protected MboxStorageReader(String fileName, boolean leaveOpen)
Initializes a new instance of the MboxStorageReader class.
fileName - Name of the file.leaveOpen - if set to true leaves the underlying stream open after disposing.com.aspose.ms.System.ArgumentNullException - If filename is null or empty.protected MboxStorageReader(InputStream stream, MboxLoadOptions options)
Initializes a new instance of the MboxStorageReader class.
stream - The stream.options - additional options when loading a Mbox storageMboxLoadOptions.com.aspose.ms.System.ArgumentNullException - If given stream is null.protected MboxStorageReader(com.aspose.ms.System.IO.Stream stream,
MboxLoadOptions options)
Initializes a new instance of the MboxStorageReader class.
stream - The stream.options - additional options when loading a Mbox storageMboxLoadOptions.com.aspose.ms.System.ArgumentNullException - If given stream is null.protected MboxStorageReader(String fileName, MboxLoadOptions options)
Initializes a new instance of the MboxStorageReader class.
fileName - Name of the file.options - additional options when loading a Mbox storageMboxLoadOptions.com.aspose.ms.System.ArgumentNullException - If filename is null or empty.public final long getCurrentDataSize()
Gets the number of bytes that is read by ReadNextMessage method.
protected final void setCurrentDataSize(long value)
Gets the number of bytes that is read by ReadNextMessage method.
@Deprecated public static MboxStorageReader createReader(InputStream stream, boolean leaveOpen)
Creates the instance of reader.
stream - The stream.leaveOpen - if set to true leaves the underlying stream open after disposing.com.aspose.ms.System.ArgumentNullException@Deprecated public static MboxStorageReader createReader(com.aspose.ms.System.IO.Stream stream, boolean leaveOpen)
Creates the instance of reader.
stream - The stream.leaveOpen - if set to true leaves the underlying stream open after disposing.com.aspose.ms.System.ArgumentNullExceptionpublic static MboxStorageReader createReader(InputStream stream, MboxLoadOptions options)
Creates the instance of reader.
stream - The stream.options - additional options when loading a Mbox storageMboxLoadOptions.com.aspose.ms.System.ArgumentNullExceptionpublic static MboxStorageReader createReader(com.aspose.ms.System.IO.Stream stream, MboxLoadOptions options)
Creates the instance of reader.
stream - The stream.options - additional options when loading a Mbox storageMboxLoadOptions.com.aspose.ms.System.ArgumentNullException@Deprecated public static MboxStorageReader createReader(String fileName, boolean leaveOpen)
Creates the instance of reader.
fileName - leaveOpen - com.aspose.ms.System.ArgumentNullExceptionpublic static MboxStorageReader createReader(String fileName, MboxLoadOptions options)
Creates the instance of reader.
fileName - options - additional options when loading a Mbox storageMboxLoadOptions.com.aspose.ms.System.ArgumentNullExceptionpublic final com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MailMessage> enumerateMessages()
Exposes the enumerator, which supports an iteration of messages in storage.
System.Collections.Generic.IEnumerableltTgt,
that represents an enumerator that iterates through a messages in storage.public abstract MailMessage readNextMessage()
Reads the next message from underlying storage stream.
MailMessage object if it can be read or <b>null</b> if no more messages are available.public abstract MailMessage readNextMessage(String[] fromMarker)
Reads the next message from underlying storage stream.
fromMarker - Gets the From Marker while parsing the MBox Storage file.MailMessage object if it can be read or <b>null</b> if no more messages are available.public abstract int getTotalItemsCount()
Returns the number of messages in a storage.
public final void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose in interface com.aspose.ms.System.IDisposablepublic void close()
close in interface Closeableclose in interface AutoCloseableprotected void dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources
disposing - true to release both managed and unmanaged resources; false to release only unmanaged resources.protected static boolean byteArrayStartsFromMarker(byte[] array,
byte[] marker)
Checks whether the array starts from given marker.
array - The array, can be null.marker - The marker, can't be null.protected static byte[] readLine(com.aspose.ms.System.IO.Stream stream)
Reads the line from stream.
stream - The stream.Copyright (c) 2008-2021 Aspose Pty Ltd. All Rights Reserved.