DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Thread: Streaming java

  1. #1
    Join Date
    Mar 2006
    Posts
    35

    Streaming java

    Does anybody have any information on streaming video and audio in java? I want to build an application that can either play streaming video or download it but I don't want to use JMF any help on where to get strated would be appreciated thanks.

  2. #2
    Join Date
    Mar 2006
    Posts
    35
    ok here's what I got so far now my question is how can I buffer the streams?

    Code:
    import java.net.*;
    import java.io.*;
     
    public class URLConnectionReader {
    	
    	
    	private static String urlString = 
    
    "http://cache.orion.sina.com.cn/client_d/200610c2/upload/c0/ba/20061101
    
    223035140619152368.mp3";
    	private static String fileName = "C:/Documents and 
    
    Settings/Compaq_Owner/Desktop/fatmacking.mp3";
    	
    	public static void main(String[] args) throws Exception {
    		
    		InputStream in = null;
            FileOutputStream out = null;
            
            try{
            	URL download = new URL(urlString);
            	URLConnection dl = download.openConnection();
    	
            	in = dl.getInputStream();
           
            	out = new BufferedOutputStream(new 
    
    FileOutputStream(fileName));
            	
            	int c;
                while ((c = in.read()) != -1) {
                    out.write(c);
                }
    		} finally {
                if (in != null) {
                    in.close();
                }
                if (out != null) {
                    out.close();
                }
    		}
    	}
    }

  3. #3
    Join Date
    Mar 2006
    Posts
    35
    Does anyone have a good tutorial link on ProgressMonitorInputStream with an example on how to do it when your reading from a urlconnection and downloading the contents to the local machines hard drive I can't find on on google?

Similar Threads

  1. Java book
    By Lou in forum Java
    Replies: 9
    Last Post: 09-19-2007, 05:58 AM
  2. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 06:46 AM
  3. learning c# very confusing.
    By Mike Tsakiris in forum .NET
    Replies: 11
    Last Post: 10-04-2002, 05:32 PM
  4. Re: VB vs. Visual Age for Java
    By JJ in forum Enterprise
    Replies: 1
    Last Post: 07-06-2000, 04:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links