我正在使用这段代码将数据保存到 .dat 文件中:
void saveFile () {
try {
FileOutputStream fos = new FileOutputStream ("File.dat", true);
DataOutputStream dos = new DataOutputStream (fos);
dos.writeUTF (saves[count][0]);
dos.writeUTF (saves[count][1]);
dos.writeUTF (saves[count][2]);
dos.writeUTF (saves[count][3]);
dos.writeUTF (saves[count][4]);
dos.writeUTF (saves[count][5]);
JOptionPane.showMessageDialog (this, "The Record has been Saved Successfully",
"Record Saved", JOptionPane.PLAIN_MESSAGE);
txtClear ();
dos.close();
fos.close();
}
catch (IOException ioe) {
JOptionPane.showMessageDialog (this, "There are Some Problem with File",
"Problem", JOptionPane.PLAIN_MESSAGE);
}
}
我需要将 .dat 文件托管在某个在线域上 说http://Domain.com/File.dat 我需要对这段代码做什么才能完成保存?