MxFormatRead.java
01 /*
02  * $Id: MxFormatRead.java,v 1.3 2008/01/12 01:54:55 koga Exp $
03  *
04  * Copyright (C) 2004 Koga Laboratory. All rights reserved.
05  *
06  */
07 package matxbook.chap14;
08 
09 import java.io.FileInputStream;
10 import java.io.IOException;
11 import java.io.InputStream;
12 
13 import org.mklab.nfc.matrix.Matrix;
14 import org.mklab.nfc.matx.MatxInteger;
15 import org.mklab.nfc.matx.MatxList;
16 import org.mklab.nfc.matx.MatxMatrix;
17 import org.mklab.nfc.matx.MatxString;
18 
19 
20 /**
21  @author koga
22  @version $Revision: 1.3 $, 2004/04/26
23  */
24 public class MxFormatRead {
25 
26   /**
27    * メインメソッド
28    
29    @param args コマンドライン引数
30    @throws IOException ファイルから読み込めない場合
31    */
32   @SuppressWarnings("nls")
33   public static void main(String[] argsthrows IOException {
34     InputStream input = new FileInputStream("data.mx");
35     int a = MatxInteger.readMxFormat(input);
36     String b = MatxString.readMxFormat(input).toString();
37     Matrix c = MatxMatrix.readMxFormat(input);
38     MatxList d = MatxList.readMxFormat(input);
39     input.close();
40 
41     System.out.println("a = " + a);
42     System.out.println("b = " + b);
43     c.print("c");
44     d.print("d");
45   }
46 }