// WRITING THE FLOATS
for (int x = 0; x < header.iNeuron; x++) {
for (int y = 0; y < header.iNeuron; y++) {
for (int z = 0; z < header.iWin; z++) {
try {
raf1.writeFloat(afNorm[x][y][z]);
} catch (IOException ex) {
Logger.getLogger(DataStore.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
// ACCESS THE FLOATS
public float[] getWindow(int xIn, int yIn) {
float result[] = new float[header.iWin];
// get the norms from the file, populate the array, and return the window
// seek first
long pos = xIn * yIn * 4;
try {
rafNorms.seek(pos);
} catch (IOException ex) {
Logger.getLogger(DataStore.class.getName()).log(Level.SEVERE, null, ex);
}
// read the window
for (int i = 0; i < header.iWin; i++) {
try {
result[i] = rafNorms.readFloat();
} catch (IOException ex) {
Logger.getLogger(DataStore.class.getName()).log(Level.SEVERE, null, ex);
}
}
return result;
}
ASKER
ASKER
ASKER
ASKER
ASKER
Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.
TRUSTED BY
long pos = xIn * yIn * 4;
but
long pos = xIn * yIn;