Advertisement
anta40

play

Sep 20th, 2012
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. public void play(String path){
  2.         try {
  3.             FileConnection fc = (FileConnection) Connector.open(path,   Connector.READ);
  4.             InputStream is = fc.openInputStream();
  5.             rawData = IOUtilities.streamToBytes(is);
  6.             byte[] buf = new byte[4096];
  7.             int len;
  8.            
  9.             while ((len = is.read(buf)) != -1){
  10.                 playEncryptedAudio(buf);
  11.             }
  12.            
  13.             is.close();
  14.             fc.close();
  15.         }
  16.         catch (IOException ioex){
  17.                
  18.         }
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement