RandomAccessFile aucune sortie
Bonjour,
Mon programme ne donne aucune sortie, pourtant il compile bien.
Voici mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| import java.io.*;
public class Randomaccess1
{
public static void main(String[]args)throws IOException
{
RandomAccessFile raf=new RandomAccessFile("random.text","rw");
try
{
Writer out=new OutputStreamWriter(new FileOutputStream(raf.getFD()),"UTF-8");
out.write("Programing in C");
out.flush();
raf.seek(12);
out.write("Java");
out.flush();
}
finally
{
raf.close();
}
}
} |
Quelqu'un saurait-il m'indiquer d'où peut venir le problème ?
Merci d'avance pour votre aide.