E' possibile velocizzare ulteriormente questo metodo?
codice:
private static void Scrivi(Object[][] matrice,
String nome_file) {
try {
FileOutputStream file = new FileOutputStream(nome_file);
PrintStream output = new PrintStream(file);
for (int i = 0; i < matrice.length; i++) {
String riga = "";
for (int j = 0; j < matrice[0].length; j++) {
if (j < matrice[0].length - 1) {
riga = riga + matrice[i][j] + ",";
}
if (j == matrice[0].length - 1) {
riga = riga + matrice[i][j];
}
}
output.println(riga);
riga = "";
}
} catch (IOException e) {
System.out.println("Errore nella scrittura del file .CSV");
System.exit(1);
}
}