?? findsection.java
字號:
import java.io.*;
public class FindSection
{
public int section = 0;
public int endsec = 0;
public FindSection(String path)
{
try
{
DataInputStream in = new DataInputStream(new BufferedInputStream((new FileInputStream(path))));
BufferedReader bf = new BufferedReader(new InputStreamReader(in));
// String dd = bf.readLine();
int secNo = 0;
int pos = 0;
String ss = "";
while(!(ss.equals("EOF")))
{
ss = bf.readLine();
pos++;
if(ss.equals("SECTION"))
{
secNo++;
}
if(secNo == 5)
{
section = pos;
while(!ss.equals("ENDSEC"))
{
ss = bf.readLine();
pos++;
}
endsec = pos;
ss = "EOF";
}
}
}
catch(IOException e)
{
System.out.print(e);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -