Hi,
I'm new to Java and struggle with this issue. I tried popular hint from internet as followed but it
kept writing in huge number. For example, if I have a 101 by101 array of decimal numbers, and would like
to save in a BINARY file (.dat). Here is my code. Do you see anything wrong, and any suggestions? Thanks
public static void main(String[] args) throws IOException{ ... ... String strFilePath3 = ("C://Users//Documents//workspace//" + "filename"); try { FileOutputStream fos3 = new FileOutputStream(strFilePath3); DataOutputStream dos3 = new DataOutputStream(fos3); int n=0; int i; for (int j=0; j<2dimenarray.length; j++){ for (i=0; i<2dimenarray.length; i++){ dos3.writeDouble(2dimenarray[i][j]); } fos3.close(); } catch(FileNotFoundException ex) { System.out.println("FileNotFoundException : " + ex); } catch(IOException ioe) { Sys } }