/******************************************************* Mosel User Guide Example Problems ================================= file ugstreamdensescrmt.java ```````````````````````````` Exchanging data between model and host application using Java streams. - Dense data array and scalar data - (c) 2022 Fair Isaac Corporation author: S. Heipcke, Jan 2022 ********************************************************/ import java.io.*; import java.nio.*; import com.dashoptimization.*; public class ugstreamdensescrmt { // Input data static final double[] vdata={15,100,90,60,40,15,10, 1}; // VALUE static final double[] wdata={ 2, 20,20,30,40,30,60,10}; // WEIGHT public static class MyData // Scalars for data in/output { public int wmax; public double objval; } // Array to receive solution values static final int SOLSIZE=8; static double[] solution = new double[SOLSIZE]; // A stream to send the 'MyData' array in a form suitable for the 'raw:' driver public static class MyInitStream extends InputStream { int ndx; double mydata[]; MyInitStream(double data[]) { ndx=0; mydata=data; } public int read(byte[] b) { ByteBuffer buf; byte [] bs; if(ndx