I have implemented this. Now DataSource can be created from input stream openers, from reader openers, from files and from filenames. Regardless of how they are created, we can open an InputStream or a Reader from them. If the DataSource was created from input stream opener, we use UTF-8 for conversion when getting a Reader. If the DataSource was created from a reader opener, we just use that, and we have to convert back to an InputStream only if the consumer for this data asks for an InputStream because it supports only that. The DataSource can tell if its raw data is binary or characters, so consumers can choose if they request an InputStream or a Reader for better efficiency if they can support both. This way, consumers that only support one type of input (binary or characters) just open what they want, it will be converted on the fly.
Of course, if users have already open the Reader and donāt want to use the lazy opening feature, they just use a lambda function as the reader opener: new DataSource(name, () -> reader).
The LexicalAnalyzerSelector and the XmlLexicalAnalyzer have been adapted as they can handle both binary and characters and so they ask the DataSource what raw data it has, and they adapt to that, thus avoiding back and forth conversions.
I was trying to write a sample Orekit-generated OEM file, by reproducing the example:
But, Iāve noticed that, since Orekit 11, class org.orekit.files.ccsds.OEMWriter was deprecated and replaced by org.orekit.files.ccsds.ndm.odm.oem.OemWriter which has a different constructor. Iāve tried the Python code:
You can first look at the last version of the Orekit tutorials which are based on Orekit 11.0. On the Phasing tutorial, you have an example on how to write an OEM file during an orbit propagation.
You will also find examples on the Orekitās test calsses for the writing of OEM files. The OemWriterTest class and AbstractWriterTest can help you a lot (OemWriterTest extends AbstractWriterTest class).
The above examples are in Java. I saw in a previous post that you use Python. I unfortunately donāt have any Python example ā¦