maxhutch / jpif

Java tools for working with PIF's

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JPIF

Java tools for working with Physical Information Files (http://www.citrine.io/pif).

This package includes java objects for all items in the Physical Information File (PIF). Files formatted in the PIF schema can be serialized and deserialized using included methods.

Usages

Reading PIF-formatted sources

Given an input stream, reader, or string, PIF systems can be read using e.g.

PifObjectStream pifObjectStream = new PifObjectStream(inputStream);
for (System system : pifObjectStream) {
    // Do work on system
}
pifObjectStream.close();

Writing PIF records

Writing a single PIF system to a string:

System system = new System();
String systemString = PifObjectMapper.getInstance().writeValueAsString(system);

Writing a list of PIF systems to a string:

List<System> systems = new ArrayList<>();
String systemsString = PifObjectMapper.getInstance().getSystemListWriter().writeValueAsString(systems);

Converting a PIF system, list of PIF systems, or PifObjectStream to an InputStream:

InputStream inputStream = new PifInputStream(pifObjectStream);

About

Java tools for working with PIF's

License:Apache License 2.0


Languages

Language:Java 100.0%