public class RJEWriter extends AbstractWriter
AbstractWriter
writer
Constructor and Description |
---|
RJEWriter(File file)
Constructs a RJEWriter to write content into a file.
|
RJEWriter(OutputStream stream)
Constructs a RJEWriter to write content into a given stream.
|
RJEWriter(String filename)
Constructs a RJEWriter to write content into a file.
|
RJEWriter(Writer writer)
Constructs a RJEWriter to write content into a given Writer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
write(AbstractMT msg)
Writes the message into the internal writer in RJE format
|
static void |
write(AbstractMT msg,
Writer writer) |
void |
write(String msg)
Writes the message content into the internal writer in RJE format.
|
static void |
write(String msg,
Writer writer)
Static implementation to write the message content into the parameter writer in RJE format.
|
close, flush
public RJEWriter(Writer writer)
writer
- public RJEWriter(File file) throws FileNotFoundException
file
- FileNotFoundException
public RJEWriter(String filename) throws FileNotFoundException
filename
- file to createFileNotFoundException
public RJEWriter(OutputStream stream)
stream
- public void write(String msg) throws IOException
msg
- SWIFT MT content to writeIOException
- if an I/O error occurspublic void write(AbstractMT msg) throws IOException
msg
- message to writeIOException
- if an I/O error occurspublic static void write(AbstractMT msg, Writer writer) throws IOException
msg
- message to writewriter
- IOException
- if an I/O error occurswrite(String, Writer)
public static void write(String msg, Writer writer) throws IOException
IMPORTANT: this method will always append a trailing CRLF and $ at the end which in some platforms can be rejected as an invalid RJE file. For a more compliant version use the non static implementation of the write calls, to ensure the split separator is present only between messages but not afterwards the last one.
msg
- SWIFT MT content to writewriter
- IOException
- if an I/O error occurs