* @return An outputstream directed to the message
*/
public OutputStream getRawMessageOutputStream(File messageFile,boolean compress, boolean encrypt) throws IOException,MessageStoreException {
if (messageFile==null)
throw new MessageStoreException("assertion failure: null messageFileName",logger);
OutputStream os = new BufferedOutputStream(new FileOutputStream(messageFile));
Cipher ecipher = null;
if (encrypt) {
try {
ecipher = Cipher.getInstance(key.getAlgorithm());
ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
} catch (Exception e) {
logger.fatal("Please ensure you have the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files installed.");
logger.fatal("Visit http://java.sun.com2/javase/downloads/index.jsp to download them.");
throw new MessageStoreException("failed to initalize cipher. Cause:",e,logger);
}
os = new CipherOutputStream(os,ecipher);
}