When the Hl7InputStreamMessageStringIterator is used to read an input stream from a file containing non HL7 content, it returns silently without throwing an exception or erroring out.
Example code:
package com.example;
import ca.uhn.hl7v2.util.Hl7InputStreamMessageStringIterator;
import java.io.FileInputStream;
public class HL7FileRead {
public static void main(String[] args) {
try {
FileInputStream fis = new FileInputStream("<filepath>");
Hl7InputStreamMessageStringIterator it = new Hl7InputStreamMessageStringIterator(fis);
while (it.hasNext()) {
String msg = it.next();
System.out.println(msg);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Say the file contains the following content
{
"abc":"def"
}
The program will exit silently without throwing any exceptions or errors.
When the
Hl7InputStreamMessageStringIterator
is used to read an input stream from a file containing non HL7 content, it returns silently without throwing an exception or erroring out.Example code:
Say the file contains the following content
The program will exit silently without throwing any exceptions or errors.