have linear-type-safe source codes of mp3decoder
[IRC.git] / Robust / src / Tests / ssJava / mp3decoder / MP3Player.java
index bd623697e0aea58ef3f4e724599371672d1d1719..7c182410a5374fb6ebda65b1f42262a66459263b 100644 (file)
@@ -3,14 +3,14 @@ public class MP3Player {
 
   private String filename = null;
 
-  public static void main(String args[]) {
+  public static void main(@DELEGATE String args[]) {
 
     MP3Player player = new MP3Player();
     player.init(args);
 
   }
 
-  private void init(String[] args) {
+  private void init(@DELEGATE String[] args) {
     if (args.length == 1) {
       filename = args[0];
     }
@@ -20,22 +20,22 @@ public class MP3Player {
   /**
    * Playing file from FileInputStream.
    */
-  protected InputStream getInputStream() throws IOException {
-    FileInputStream fin = new FileInputStream(filename);
-    BufferedInputStream bin = new BufferedInputStream(fin);
-    return bin;
-  }
+  // protected InputStream getInputStream() throws IOException {
+  // FileInputStream fin = new FileInputStream(filename);
+  // BufferedInputStream bin = new BufferedInputStream(fin);
+  // return bin;
+  // }
 
   public void play() throws JavaLayerException {
     try {
       System.out.println("playing " + filename + "...");
-      InputStream in = getInputStream();
+      BitstreamWrapper.init(filename);
       AudioDevice dev = new AudioDevice();
-      Player player = new Player(in, dev);
+      Player player = new Player(dev);
       player.play();
     } catch (IOException ex) {
       throw new JavaLayerException("Problem playing file " + filename, ex);
-    } 
+    }
   }
 
 }
\ No newline at end of file