public class HL7FileReader extends Object implements HL7Reader, Closeable
The "file format" is as follows:
MSH segment| Modifier and Type | Field and Description |
|---|---|
protected BufferedReader |
reader |
| Constructor and Description |
|---|
HL7FileReader(InputStream in)
Convenience constructor.
|
HL7FileReader(Reader in)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying reader.
|
protected String |
nextLine()
Read next non-ignorable line.
|
protected void |
pushback(String line)
Save the line for next time.
|
HL7Message |
readMessage()
Read next message from the underlying stream.
|
protected final BufferedReader reader
public HL7FileReader(Reader in)
in - underlying readerpublic HL7FileReader(InputStream in)
HL7FileReader(new InputStreamReader(in, StandardCharsets.ISO_8859_1))
in - underlying input streampublic HL7Message readMessage() throws IOException, HL7ContentException
readMessage in interface HL7ReaderEOFException - if there is no more inputHL7ContentException - if a malformed message is readIOException - if an error occurs on the underlying streamprotected void pushback(String line)
line - line to push backRuntimeException - if there is already one savedprotected String nextLine() throws IOException
IOException - if an I/O error occurspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2018. All rights reserved.