Results 1 to 1 of 1
Thread: Data array to file
-
Data array to file
Writing data array to the file is simple as shown in the code snippet below.
Java Code:try { // Create an output stream to the file. FileOutputStream file_output = new FileOutputStream (file); // Wrap the FileOutputStream with a DataOutputStream DataOutputStream data_out = new DataOutputStream (file_output); // Write the data to the file in an integer/double pair for (int i=0; i < i_data.length; i++) { data_out.writeInt (i_data[i]); data_out.writeDouble (d_data[i]); } // Close file when finished with it.. file_output.close (); } catch (IOException e) { System.out.println ("IO exception = " + e ); }
Similar Threads
-
Regarding Tabular data from .doc file
By praveen83 in forum Advanced JavaReplies: 10Last Post: 03-23-2010, 12:26 PM -
Saving data in an XML file
By Thez in forum New To JavaReplies: 1Last Post: 12-08-2007, 10:24 PM -
add data into an array
By mispeed in forum New To JavaReplies: 9Last Post: 11-08-2007, 04:53 AM -
Add data to an array
By adlb1300 in forum New To JavaReplies: 8Last Post: 11-05-2007, 03:01 AM -
Reading Data from a file
By ramachandran in forum New To JavaReplies: 2Last Post: 10-24-2007, 08:22 AM
Bookmarks