import java.io.*;
public class File_S
{
public static void main(String args[])
{

FileWriter fout = null;
try
{
fout = new FileWriter("dati.txt");
}
catch(IOException e)
{
System.out.println("Errore nell' apertura del file");
System.exit(1);
}

try
{
String buffer = null;



buffer = Integer.toString(5);
fout.write(buffer,0,buffer.length());
fout.close();
}

catch (IOException e)
{
System.out.println("Errore di scrittura");
System.exit(2);
}
}
}

come faccio a salvare nel file una matrice al posto del valore 5?