Bonjour,
J'espère que cen'est pas encore un truc évident pour tout le monde, mais sur la classe suivante je suis venu à bout de toutes les erreurs de compilation sauf une.
Sur la clause "finally", Eclipse me dit
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 package sub; import java.io.*; public class TsFinder{ String fileName; TsFinder(String s){fileName=s;} //Constructeur avec fourniture du nom public int getStart(){ int inByte; int iBase=0; int iCycle=0; int iSuccess=0; boolean isFound=false; int offset=0; BufferedInputStream inStream; try{ inStream = new BufferedInputStream (new FileInputStream(fileName)); while((inByte=inStream.read())!=-1){ if (isFound==true){ if ((inByte==0x47)&(iCycle==188)){ iSuccess++; iCycle=0; } }else { if(inByte==0x47){ isFound=true; offset=iBase; } } } }catch (FileNotFoundException ef){ System.out.println("File not found"); }catch (IOException e){ System.out.println(e); }finally{ if(inStream!=null) inStream.close(); } return offset; } }
1. Unhandled exception type IOException
2. The local variable inStream may not have been initialized.
3. The local variable inStream may not have been initialized.
Merci des avis de spécialistes
Gabier
Partager