Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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));
}



Children Display
alltrue

Example model adapter (includes source code)

...

FEWS_Example_Model_Adapter.43253.zip