1 import com
.google
.gson
.Gson
;
3 import java
.io
.BufferedReader
;
4 import java
.io
.FileInputStream
;
5 import java
.io
.InputStream
;
6 import java
.io
.InputStreamReader
;
9 private String continent
;
15 @SuppressWarnings("SpellCheckingInspection")
16 public void lectureOrigine(String continent
, String pays
){
17 Gson gson
= new Gson();
18 Region r
= new Region();
21 InputStream flux
= new FileInputStream(continent
+ ".txt");
22 InputStreamReader lecture
=new InputStreamReader(flux
);
23 BufferedReader buff
=new BufferedReader(lecture
);
25 while ((ligne
=buff
.readLine())!=null){
31 System
.out
.println(e
.toString());
33 System
.out
.println("les information du pays" + pays
+" du fichier est : "+contenu
);
34 // maintenant je veux deserialiser
35 Origin coords3
= gson
.fromJson(contenu
,Origin
.class);
36 //Coordonnees co = gson.fromJson(json,Coordonnees.class);
37 System
.out
.println("Resultat = " + coords3
);