Following the open question: Java equivalent for the NumPy multi-dimensional object, I ended up implementing my own numerical methods in Java. But it seems that the final output is too big (almost twice larger than NumPy). Python does not have numerical types like int, long, float, or double but I believe NumPy converts everything to the byte. Since I implemented my program in Java, I had to use those standard numerical types (double[][][], long[][], etc…), and when I save my results into a file through FileWriter, the size of the output is almost twice as larger as the NumPy functions:
FileWriter fstream = new FileWriter(outName, true);
BufferedWriter out = new BufferedWriter(fstream);
for (int i = 0; i < nFramesBack; i += 2) {
double[][] data1 = imageObjArray[i];
for (int j = 0; j < 128; j++) {
for (int k = 0; k < 128; k++) {
imageObjArray[i][j][k] = data1[j][k] * flatfB[j][k];
out.write(data1[j][k] * flatfB[j][k] + " ");
}
out.newLine();
}
out.newLine();
}
out.flush();
out.close();
I am looking for a solution to convert my output into a byte format like NumPy.