| java.lang.Object com.knowgate.hipermail.MboxFile
MboxFile | public class MboxFile (Code) | | Provides access to an mbox-formatted file.
author: Ben Fortuna adapted to hipergate by Sergio Montoro Ten version: 3.0 |
MboxFile | public MboxFile(String filepath)(Code) | | Constructor.
Parameters: filepath - Parameters: mode - Either MboxFile.READ_ONLY or MboxFile.READ_WRITE |
appendMessage | final public long appendMessage(MboxFile source, long srcpos, int srcsize) throws IOException(Code) | | Appends the specified message from another mbox file
Parameters: source - Source mbox file Parameters: srcpos - Byte offset position of message at source mbox file Parameters: srcsize - Size of source message in bytes byte offset position where message is appended on this mbox file throws: IOException - |
appendMessage | final public long appendMessage(MboxFile source, int index) throws IOException(Code) | | Appends the specified message from another mbox file
Parameters: source - Source mbox file Parameters: index - Index of message to be appended at the source file byte offset position where message is appended on this mbox file throws: IOException - |
appendMessage | final public long appendMessage(CharSequence message) throws IOException(Code) | | Appends the specified message (represented by a CharSequence) to the
mbox file.
Parameters: message - |
getMessage | public CharSequence getMessage(int index) throws IOException(Code) | | Returns a CharSequence containing the data for
the message at the specified index.
Parameters: index - the index of the message to retrieve a CharSequence |
getMessageAsStream | public InputStream getMessageAsStream(long begin, int size) throws IOException(Code) | | Get message as stream
Parameters: begin - long Byte offset position for message Parameters: size - int Number of bytes to be readed InputStream throws: IOException - |
getMessageAsStream | public InputStream getMessageAsStream(int index) throws IOException(Code) | | Opens an input stream to the specified message
data.
Parameters: index - the index of the message to opena stream to an input stream |
getMessageCount | public int getMessageCount() throws IOException(Code) | | Returns the total number of messages in the mbox file.
an int |
getMessagePosition | public long getMessagePosition(int index) throws IOException, ArrayIndexOutOfBoundsException(Code) | | Get byte offset position of a given message inside the mbox file
This method is slow when called for the first time, as it has to parse
the whole Mbox file for finding each message index.
Parameters: index - Message Index message byte offset position inside the mbox file throws: IOException - throws: ArrayIndexOutOfBoundsException - |
getMessagePositions | public long[] getMessagePositions() throws IOException(Code) | | Returns an initialised array of file positions
for all messages in the mbox file.
a long array throws: IOException - thrown when unable to readfrom the specified file channel |
|
|