OSDN Git Service

bs check implement.
[rec10/rec10-git.git] / jTsSplitter / trunk / src / jtssplitter / Chlist.java
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5
6 package jtssplitter;
7
8 import java.io.FileWriter;
9 import java.io.IOException;
10 import java.util.logging.Level;
11 import java.util.logging.Logger;
12
13 /**
14  *
15  * @author yukikaze
16  */
17 public class Chlist {
18     public void writeCHList(String tspath,String listpath,int min,int max){
19         FileWriter fw = null;
20         try {
21             Tsfile tsf = new Tsfile();
22             Integer[] programnum = tsf.getProgramNum_byte(tspath);
23             String str = "";
24             for (int i = 0; i < programnum.length; i++) {
25                 if (!(min >0 && min>programnum[i])){
26                     if (!(max >0 && max<programnum[i]))
27                         str = str + programnum[i].toString() + "\n";
28                 }
29             }
30             fw = new FileWriter(listpath);
31             fw.write(str);
32             fw.close();
33         } catch (IOException ex) {
34             Logger.getLogger(Chlist.class.getName()).log(Level.SEVERE, null, ex);
35         } finally {
36             try {
37                 fw.close();
38             } catch (IOException ex) {
39                 Logger.getLogger(Chlist.class.getName()).log(Level.SEVERE, null, ex);
40             }
41         }
42     }
43 }