public static void escrever_Contracto() {
        try {  // Catch errors in I/O if necessary.
            // Open a file to write to, named SavedObj.dat.
            FileOutputStream saveFile = new FileOutputStream("Contracto.dat");
            
            FileOutputStream saveFileH = new FileOutputStream("Contracto_Hist.dat");

            // Create an ObjectOutputStream to put objects into save file.
            ObjectOutputStream save = new ObjectOutputStream(saveFile);
            
            ObjectOutputStream saveH = new ObjectOutputStream(saveFileH);

            // Now we do the save.
            save.writeObject(list);
            save.writeLong(Contracto.getId_aux_contracto());

            saveH.writeObject(historico);

            // Close the file.
            save.close(); // This also closes saveFile.
        } catch (Exception exc) {
            exc.printStackTrace(); // If there was an error, print the info.
        }
    }