Package org.dellroad.hl7.io
Class HL7FileWriter
- java.lang.Object
-
- org.dellroad.hl7.io.HL7FileWriter
-
-
Field Summary
Fields Modifier and Type Field Description protected BufferedWriterwriter
-
Constructor Summary
Constructors Constructor Description HL7FileWriter(OutputStream out)Convenience constructor.HL7FileWriter(Writer out)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the underlying writer.voidwriteMessage(HL7Message message)Write the given message to the underlying output (and then flush it).
-
-
-
Field Detail
-
writer
protected final BufferedWriter writer
-
-
Constructor Detail
-
HL7FileWriter
public HL7FileWriter(Writer out)
Constructor.- Parameters:
out- underlying writer
-
HL7FileWriter
public HL7FileWriter(OutputStream out)
Convenience constructor. Equivalent to:HL7FileWriter(new OutputStreamWriter(out, StandardCharsets.ISO_8859_1))- Parameters:
out- underlying input stream
-
-
Method Detail
-
writeMessage
public void writeMessage(HL7Message message) throws IOException
Write the given message to the underlying output (and then flush it).- Specified by:
writeMessagein interfaceHL7Writer- Parameters:
message- message to write- Throws:
IOException- if an I/O error occurs
-
close
public void close() throws IOExceptionCloses the underlying writer.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-