Package org.dellroad.hl7.llp
Class LLPOutputStream
- java.lang.Object
-
- org.dellroad.hl7.llp.LLPOutputStream
-
-
Constructor Summary
Constructors Constructor Description LLPOutputStream(OutputStream output)Constructor for whenStandardCharsets.ISO_8859_1character encoding is to be used for all messages.LLPOutputStream(OutputStream output, Charset charset)Constructor for when a fixed character encoding is to be used for all messages.LLPOutputStream(OutputStream output, CharsetDecoder charsetDecoder)Primary constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close this output stream.voidwriteMessage(HL7Message message)Write a message using HL7 LLP framing and flush the underlying output.
-
-
-
Constructor Detail
-
LLPOutputStream
public LLPOutputStream(OutputStream output)
Constructor for whenStandardCharsets.ISO_8859_1character encoding is to be used for all messages.Equivalent to:
LLPOutputStream(output,StandardCharsets.ISO_8859_1).- Parameters:
output- underlying output stream- Throws:
IllegalArgumentException- ifoutputis null
-
LLPOutputStream
public LLPOutputStream(OutputStream output, Charset charset)
Constructor for when a fixed character encoding is to be used for all messages.- Parameters:
output- underlying output streamcharset- character encoding for all messages- Throws:
IllegalArgumentException- if either parameter is null
-
LLPOutputStream
public LLPOutputStream(OutputStream output, CharsetDecoder charsetDecoder)
Primary constructor.- Parameters:
output- underlying output streamcharsetDecoder- determines the character encoding to use for each outgoing message- Throws:
IllegalArgumentException- if either parameter is null
-
-
Method Detail
-
writeMessage
public void writeMessage(HL7Message message) throws IOException
Write a message using HL7 LLP framing and flush the underlying output.- Specified by:
writeMessagein interfaceHL7Writer- Parameters:
message- message to write- Throws:
IOException- if an I/O error occurs
-
close
public void close() throws IOExceptionClose this output stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-