assertSessionCreated();
try
{
// This is the behavior of append = false in FileOutputStream
session.truncateFile(f, 0L);
XAFileOutputStream xaStream = session.createXAFileOutputStream(f, false);
return new XAFileOutputStreamWrapper(xaStream);
}
catch (Exception e)
{
throw new ResourceTransactionException("Error while creating output stream for " + f, e);