OSDN Git Service

add chlist output option.
[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){
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                 str = str + programnum[i].toString() + "\n";
26             }
27             fw = new FileWriter(listpath);
28             fw.write(str);
29             fw.close();
30         } catch (IOException ex) {
31             Logger.getLogger(Chlist.class.getName()).log(Level.SEVERE, null, ex);
32         } finally {
33             try {
34                 fw.close();
35             } catch (IOException ex) {
36                 Logger.getLogger(Chlist.class.getName()).log(Level.SEVERE, null, ex);
37             }
38         }
39     }
40 }