1 46 package sample.blocks.stream.file; 47 48 import java.io.File ; 49 import java.io.FileInputStream ; 50 51 import org.mr.api.blocks.MantaInputStream; 52 import org.mr.api.blocks.MantaOutputStream; 53 54 58 59 63 public class MediaStreamCaster { 64 65 public static void main(String [] args) throws Exception { 66 if(args==null) 67 System.err.println ("error: the path to the Wav input stream must be entered."); 68 FileInputStream fis = new FileInputStream (new File (args[0])); 69 70 MantaOutputStream cast = new MantaOutputStream(MediaStreamReceiver.BLOCK_SIZE); 71 cast.connect(MediaStreamReceiver.queueName, MantaInputStream.QUEUE); 72 int read; 73 while(( read= fis.read())!=-1){ 74 cast.write(read); 76 } 77 cast.close(); 78 System.out.println("The stream file was enqueued to queue "+MediaStreamReceiver.queueName); 79 }} 81 | Popular Tags |