How many images per sec can I get from ImageIO.read(url) ??????

Hello,
In my program I read images from a url...I'm wondering how many images I can get with ImageIO.read(url) per second..
Hereby is the code that I'm using:
import java.awt.*; //Contains all of the classes for creating user interfaces and for painting graphics and images
import java.awt.event.*;//Provides interfaces and classes for dealing with different types of events fired by AWT components
import java.awt.image.*;//Provides classes for creating and modifying images
import java.io.*;//Provides for system input and output through data streams, serialization and the file system
import java.net.URL;
import javax.imageio.*;//The main package of the Java Image I/O API.
import javax.swing.*;//Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms.
import java.text.*;
import java.text.SimpleDateFormat;
import java.util.Date;
public class getPic extends Component{
private BufferedImage img;
    static int n=0;
    private URL url;
    private DateFormat dateFormat;
    private Date date;
    private String s;
    private String str1= ".jpeg";
    private String str2="C:\\Users\\";
    private String str3;
    private String str4;
      public getPic() {
     try {
              url = new URL("http://"); //a url that gives a real-time image
              img = ImageIO.read(url);
            } catch (IOException e) {
           System.err.println("Unable to read file");
public void savePic(){
try{
n++;
str3=str2.concat(Integer.toString(n-1));
                    str4=str3.concat(str1);
                    ImageIO.write(img, "jpeg" , new File(str4));
                } catch(IOException e) {
                  System.err.println("Unable to output results");
@Override
    public Dimension getPreferredSize() {
        if (img == null) {
           return new Dimension(100,100);
        } else {
           return new Dimension(img.getWidth(), img.getHeight());
    @Override
      public void paint(Graphics g) {  //http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Paint.html
        g.drawImage(img, 10, 10, null);//http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Graphics.html
    public static void main(String[] args) throws IOException {
       JFrame f = new JFrame(" Image without processing!!");
       f.addWindowListener(new WindowAdapter(){//http://java.sun.com/j2se/1.4.2/docs/api/java/awt/event/WindowListener.html
            @Override
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
    int i=0;
    for( ; ; ){
        i++;
        getPic pi = new getPic();
        pi.savePic();
        f.add(pi);
        f.pack();  //Causes this Window to be sized to fit the preferred size and layouts of its subcomponents.
        f.setVisible(true);
     try
        Thread.sleep(1000);
        }catch (InterruptedException ie)
        System.out.println(ie.getMessage());
}Thank you in advance for your answers
Joan

Finally I solved my problem(getting as many images as possible from a url infinitely) using the above code:
import java.net.*;
import java.io.*;
public class UserApplication {
    private static int n=0;
    String url;
  public void UserApplication(){
    public static void main(String[] args) throws Exception {
        UserApplication app= new UserApplication();
        for(;;){
        app.urlStr();
    private void urlStr(){
        try{
            url= "http://mplamplampla/frame.php/";
            HttpURLConnection con=(HttpURLConnection) ((new URL(url).openConnection()));
            BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream("C:\\Users\\mpla\\Desktop\\" + n + ".jpeg"));
            con.setDoInput(true);
            con.setDoOutput(false);
            con.setRequestMethod("GET");
            BufferedInputStream in = new BufferedInputStream(con.getInputStream());
            int bt = 0;
            byte[] buffer = new byte[4096];
            while ((bt = in.read(buffer, 0, 4096)) > -1) {
              out.write(buffer, 0, bt);
            in.close();
            out.close();
            System.out.println("Image " + n + " saved");
            n++;
            } catch (Exception e) {e.printStackTrace();}
}

Similar Messages

  • Have purchased Adobe CC today. How many more apps I can use apart from photoshop, illustrator and indesign. Can I use all the listed apps within the membership fees charged per month? Or I will be charged extra?

    Have purchased Adobe CC today. How many more apps I can use apart from photoshop, illustrator and indesign. Can I use all the listed apps within the membership fees charged per month? Or I will be charged extra?

    Cloud Plans https://creative.adobe.com/plans
    -and subscription terms http://www.adobe.com/misc/subscription_terms.html
    -what is in the entire Cloud http://www.adobe.com/creativecloud/catalog/desktop.html

  • Is there a restriction on how many simultaneous wireless iPads can watch movies from one iTunes account or AppleTV generation 2 or later?

    Is there a restriction on how many simultaneous wireless iPads can watch movies from one iTunes account or AppleTV generation 2 or later?

    Welcome to the Apple Community.
    I find it hard to believe that this information isn't clearly available somewhere, but it isn't and I don't think I've seen anyone here who is 100% sure. However, I believe you can have up to 10 associated devices, which include authorised computers (of which you can have up to 5), I suspect the Apple TV might become a temporary associated device while it's in use, but I'm not entirely sure myself.

  • How many images can iPhoto 2.01 hold?

    How many images can iPhoto 2.01 hold? What's the maximum.
    And why does iPhoto occassionally crash when dragging folders of images into the Album list area?
    thanks,
    Hairfarmer

    I have 70,000 RAW images arranged in directories by year/day.  The only thing slow about it is during catalog backup. When first starting LR it takes a couple of minutes to enumerate the dates with photo counts, but that occurs in the background.  I detect no database related slowness while editing or performing random accesses and searches.  I have seen no difference in the above after having upgraded to V4.
    The only slowness that I find annoying has nothing to do with the database.  It is after a certain number of spot removals of varying sizes. The larger and/or more varied the spot size tends to accelerate this.  At some point it starts disk thrashing and becomes impossible to work with (I have to back up to a history step when it was running OK, which can take several minutes).  When this occurs the task manager shows a high rate of page faults, meaning it is swapping out stuff to disk (even though I have plenty of unused ram).  This suggests a problem with the compiler, but that is just an wild educated guess.

  • How many images can LR4 catalog hold?

    I have been using Lightroom since version 1, it is my main editing software. LR4 is brilliant, however I it seems to run much slower then LR3 especially in the print module. I'm thinking this maybe due to the size of my catalog. How many images can a catelog hold?
    Many thanks
    RP

    I have 70,000 RAW images arranged in directories by year/day.  The only thing slow about it is during catalog backup. When first starting LR it takes a couple of minutes to enumerate the dates with photo counts, but that occurs in the background.  I detect no database related slowness while editing or performing random accesses and searches.  I have seen no difference in the above after having upgraded to V4.
    The only slowness that I find annoying has nothing to do with the database.  It is after a certain number of spot removals of varying sizes. The larger and/or more varied the spot size tends to accelerate this.  At some point it starts disk thrashing and becomes impossible to work with (I have to back up to a history step when it was running OK, which can take several minutes).  When this occurs the task manager shows a high rate of page faults, meaning it is swapping out stuff to disk (even though I have plenty of unused ram).  This suggests a problem with the compiler, but that is just an wild educated guess.

  • Is there any limit on how many records a cursor can hold?

    Hi Everyone,
    This is Amit here. I want to know whether there is any limit on how many records a cursor can hold.
    I have a program in which i am creating a cursor and passing it to another procedure as an input parameter. But the count of cursor query is more than 15 Lakhs. The program is running forever.
    Just wanted to know whether the huge data is the problem.
    Thanks ....
    Regards,
    Amit

    user13079404 wrote:
    Just wanted to know whether the huge data is the problem.What do you think? How long does your code typically need to wait for the data to leave the magnetic platter of the harddisk, travel across wires and into the memory buffer of your application - for a single row?
    Now multiply that waiting for I/O time with a million - for a million rows. Or by a billion, for a billion rows.
    Is "+huge data+" a problem? Not really - it simple needs more work to get that amount of data from disk. More work means slower performance. It is that simple.
    Which is why the row-by-row approach used by many developers is wrong. You do not pull a million rows from disk and process it in PL/SQL or Java or .Net. Heck, you do not even pull 10,000 rows like that.
    The correct approach is to think data sets and use SQL to process that for you - and only return the bare minimum of data to the application layer. Maximize SQL. Minimize PL/SQL and Java and .Net.

  • Memory usage Adobe Photoshop Elements 9 - How many images are too many?

    My wife and I are having a discussion about the memory allocation of Adobe PSE 9.
    We run both of our profiles logged in on a 27" iMac top end from May, 2010, with 12 GB of RAM.
    She had a number of pictures open (let's say 20 - 25) that she was working on editing.  Trying to shut the program down or work within it, the spinning wheel of death made a cameo appearance and brought the system to a crawl.
    I ran Activity Monitor and it said that she had 746 MB of memory free out of 7.39 GB active and 11.27 GB used.  With each image I closed, I gained an additional 5 - 7 MB of free memory.
    Once I force quit PSE 9, that number jumped to nearly 2.5 GB free.
    For those with experience using PSE 9, can you give me an indication:
    How many images do you have open that you're working with at the same time?
    For those people with more Mac OS X experience, would having 750 MB free out of 12 GB reduce the computer to a crawl?
    Thanks in advance.

    As a general rule of thumb (some will disagree with me) if your machine has about 500MB of Free RAM or less this will slow down the computer significantly. Also as a general rule you can never have too much RAM. One nice thing about your machine is it can be upgraded up to as much as 32GB of RAM however 8GB chips are EXTREMELY expensive right now and currently only OWC sells a kit. You can upgrade to 16GB for a lot less, whether you need it or not no one here can say for sure. I would continue to keep an eye on Activity Monitor and keep my first sentence in the back of your mind.
    Roger

  • How many partners or competitors can be associated with an account ?

    Hi,
    how many partners or competitors can be associated with an account ? Is there any limitations on this. As per the client requirement i need to add 1000 or more partners to one account.
    Kindly help me on this.
    @ Bob: Please help with any reference document if any?

    Hi Royston,
    Thanks for the response. Could you please hep me on How to import partners or compettitors to parent account. By using Import wizard it is not possible, can i try with data loader or webservice.
    Subbu

  • Does Adobe Send allow you to select how many days your files can be downloaded - as with Adobe Send Now? Also, why don't I see the virus scanning message any longer with "Send" versus "Send Now"?

    Does Adobe Send allow you to select how many days your files can be downloaded - as with Adobe Send Now? Also, why don't I see the virus scanning message any longer with "Send" versus "Send Now"?

    We relied upon the "days available for download" to get people to take
    action more quickly. The "virus scanning" progress bar was simply another
    way of knowing this activity was actually taking place - unless this is
    written somewhere in the Adobe Send User Guide.....wherever that is.
    On Tue, Dec 2, 2014 at 12:09 PM, bob.treitman <[email protected]>

  • How many screen-on time are you getting while playing?

    How many screen-on time are you getting while playing games on the iPad Mini Retina? I'm planning to buy one and use it mainly for games. I currently own a Samsung Tab S 8.4 which can only last 4 hours screen-on time while playing Clash of Clans.

    Unfortunately no one can give you an exact length of time. The stated battery life on an iPad is in the 10 hour area. But there are so many variables that it's impossible to give you any sort of exact length.
    I would GUESS, if you spent the whole day gaming on a fresh charge, you may get 5-6 hours but that is a total blind guess. some games demand more power than others so there is no set way to know.

  • How many enterprise projects we can create in a single project web app site in project server 2013 enterprise?

    I have MS SharePoint 2013 Enterprise and MS Project Server enterprise installed in the same server,
    I have created project web app site 
    can anyone tell me that how many enterprise projects I can create in a single Project web app site
    what is the recommended number of enterprise project per project web app

    As I remember each project site is a sub site in a project Web app site collection.  That means you can have a maximum of 250,000 project sites before you run out of space in the site collection.  That's the boundary for sub sites in a single
    site collection for SharePoint 2013.  Project server doesn't have a specific limit.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • How many T code we can add to any single role?

    Dear Friends,
    How many T code we can add to any single role?
    regards,
    Sachin

    Hi Sachin,
    The catch here is not the Max limit of tCodes, but the Objects that get assigned to the role due to this addition. If they are huge number of Tcodes assigned to a role, the same would be the case with objects. i have typically added 600 + tcodes to roles at times and ) i had no chance to go beyond that limit.
    With SOX and SOD matrixes in place, i hardly have seen max Tcode number crossing 200+ at times where we break responsibiolities into small single roles.
    Hope the info helps.
    Br,
    Sri
    Award points for helpful answers

  • Approximately how many full length movies can a 30g ipod video hold?

    Approximately how many full length movies can a 30g ipod video hold?

    Most of the movies I have are around 450 mb. So for a 30 gig iPod you should get around 60 movies. I use Handbrake to rip movies for the iPod on my mac and Cucusoft to rip them on my XP machine. The size is user selectable and averages around 400 to 500 mb.
    Rick

  • How many 3rd party displays can be connected to MBP retina 15"

    I was just wondering how many 3rd party displays can be connected to the MacBook Pro with Retina Display 15" and 16GBs of ram. I have contacted the Apple Online Chat and every time I get a different awnser. I know that there are 2 Thunderbolt ports and a HDMI port on the machine. Can someone help me please?
    Thanks,
    Jayden

    Near all screens. You can use the HDMI port to connect the MacBook Pro with Retina display to a HDMI screen, but you have got Thunderbolt.
    Thunderbolt is compatible with Mini DisplayPort, so you can use Mini DisplayPort adapters to connect your MacBook to a DVI or VGA screen too

  • How many numbers  of records can be uploaded  using BDC  at a time

    dear friends,
                      i want to know that how many numbers  of records can be uploaded using BDC  at a time from legacy system(database).

    no resticsation.
    large value of data  upload.

Maybe you are looking for

  • PriceList tab not appearing in BCC

    Hi I m using ATG10.0.2 BCC, but i m not able to see the pricelist tab anywhere. I have explicitly put a property at /atg/commerce/web/Configuration.properties with usingPriceLists=true. But even then i m not able to see the pricelist tab. Any ideas?

  • ALE/Idoc BAPI FAQs?

    Hi Friends, I would like to know where can i get FAQs on ALE/Idoc and BAPI.. Thanks.. Abdul

  • Cannot open documents in new pages for iPad

    cannot open any documents in new pages for iPad

  • How can I improve performance when scopes are open?

    How can I improve performance when scopes are open? When Color correcting, performance severely lags, stalls, freezes! Nothing to complex...simple 3 way color corrector, occasional curves filters. I am constantly waiting for the timeline to update as

  • SSIS with SQL 2014

    I have recently installed SQL2014 and currently have 2 issues which may be BIDS 2012 or SQL2014 related. 1. If I deploy a package to MSDB, then try to re download and open the package in BIDS it complains that it cannot open a version 8 package in Ve