...
In memory file transfer
The Java adapters should check if a file is transferred in memory to the adapter by FEWS.
public static BufferedInputStream newInputStream(File file) throws IOException { //noinspection UseOfPropertiesAsHashtable var stream = System.getProperties().get(file); if (stream instanceof BufferedInputStream) return (BufferedInputStream) stream; return new BufferedInputStream(new FileInputStream(file)); }
public static BufferedOutputStream newOutputStream(File file) throws IOException { //noinspection UseOfPropertiesAsHashtable var stream = System.getProperties().get(file); if (stream instanceof BufferedOutputStream) return (BufferedOutputStream) stream; return new BufferedOutputStream(new FileOutputStream(file)); } |
---|
Example model adapter (includes source code)
...
FEWS_Example_Model_Adapter.43253.zip