help: writeObject is appendind data!
Hi, I am doing an app an d I need to save some configuration parameters, so I am using ObjectOutputStream and FileOutputStream, the problem is that each time I call to writeObject the configuration file is increasing and the data is being appended. But I dont want this.
my code is:
// on the constructor
try{
salidaArchivo=new FileOutputStream (path+"config.dat");
salidaDatos=new ObjectOutputStream (salidaArchivo);
}catch (Exception e){
e.printStackTrace();
}
// on my method
String data []=new String [5];
data [0]= txt_Configuracion_Puerto.getText();
data [1]= txt_Configuracion_Velocidad.getText();
data [2]= txt_Configuracion_Vendor.getText();
data [3]= txt_Configuracion_Path_Entrada.getText();
data [4]= txt_Configuracion_Path_Salida.getText();
if (data [0].compareTo("")==0){
data [0]="COM5";
}
if (data [1].compareTo("")==0){
data [1]="115200";
}
if (data [2].compareTo("")==0){
data [2]="Enfora";
}
if (data [3].compareTo("")==0){
data [3]=entrada;
}
if (data [4].compareTo("")==0){
data [4]=salida;
}
try{
salidaDatos.writeObject(data);
}catch (IOException e){
e.printStackTrace();
}
each time I call the method new data is appended. On the FileOutputStream I am not setting the appeding to true;

