import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
public class FileOper {
public String readFile(String fileName) throws IOException {
File file = new File(fileName);
FileInputStream fis;
StringBuffer sb = new StringBuffer();
fis = new FileInputStream(file);
byte[] buf = new byte[1024];
int hasRead = 0;
while ((hasRead = fis.read(buf)) > 0) {
sb.append(new String(buf, 0, hasRead));
}
fis.close();
String str = sb.toString();
int left = str.indexOf("T");
if(str.indexOf("A")
left = str.indexOf("A");
}
if(str.indexOf("G")
left = str.indexOf("G");
}
return str.substring(left+2, left+9);
}
public static void main(String[] args) throws IOException {
System.out.println(new FileOper().readFile("D:\\111\\11.txt"));
}
}