Would someone tell me the fuzzy concept

I try to use java to read a file about 16Mb to a string, first it's out of memory, and then I increase the heap use -mx200000000, make it to about 200Mb. It can handle the file, but it still take about 20-30 seconds to read it. and I use another tool like textpad to open it, after i click the filename,it open thoroughly soon. To me it's hard to understand why it takes a short time to read it. and my program can not?
but I wonder the factors that affect the speed of reading a file is my program or java's limitation. If you have any idea or hypothesis, would you please tell me, make me know more about it?
my program like this:
fis = new FileInputStream (fileName);
int size = fis.available ();
byte[] bytes = new byte [size];
fis.read (bytes);
str = new String (bytes);

You need to use a BufferedInputStream and then read from the buffer. You are doing little operations many times over which takes time. You need to do big operations and do them less frequently to improve the speed of your program.

Similar Messages

  • I am unable to connect to IPP host. Would someone tell me the steps to get this to happen for me?

    I am unable to connect to IPP host, and therefore cannot print

    fyi:
    IPP (Internet printing protocol)
    IPP is a relatively new (1999) protocol  based on the HTTP protocol. With IPP, more job-related data is transmitted than in the other protocols.       CUPS uses IPP for internal data transmission. This is the preferred protocol for a forwarding queue between two CUPS servers.  The name of the print queue is necessary to configure IPP correctly.
    The port number for IPP is 631.     
    http://www-uxsup.csx.cam.ac.uk/pub/doc/suse/suse9.2/suselinux-adminguide_en/ch12 s04.html
    This thread, suggest by the new forum software! has some interesting info:
    https://discussions.apple.com/message/13100324#13100324

  • Would someone tell me the difference between PS13 and Elements !

    what are the differences between elements 13 and PS 13

    I'm sure there's a link somewhere which lays out the differences explicitly.  But from a top level, Elements is a slimmed down version of Photoshop that is geared towards a quicker and easier user experience.  It has more "one click" options for optimizing color, reducing redeye, etc - the main, basic edits that most people want to do to their photos.   Photoshop, on the other hand, is an advanced photo editor and comes with a learning curve; it's designed to be a full fledged digital editor from the "film" photographer, to the digital artist, compositors, layout, etc.  Even basic edits can be difficult to figure out until you know your way around the program.  It' more powerful, but more difficult to learn.  That said, some people don't want to spend the time learning it, they just want some basic, quick editing tools.
    I can't remember the list off the top of my head, but Elements had a couple restrictions that made it a non-starter for me.  First and foremost, Elements won't let you edit multiple layers in 16 bits.  Something that won't affect many, but for any high level compositing it's a not go.  On top of that, they removed features like the pen tool, paths, curves, channels, smart objects, etc.  These probably don't mean anything to you, but to those of use that use PS these are the basic building blocks of our work.

  • Hey Community, i have an iphone 5 recently doesnt work, it's showing apple in middle even i connect to itunes there is nothing. Can someone tells me the problem please thank you

    Hey Community, i have an iphone 5 recently doesnt work, it's showing apple in middle even i connect to itunes there is nothing. Can someone tells me the problem please thank you

    you could try forcing it into recovery mode by turning it off, hold the home button and plug it into iTunes at the same time, keep holding the home button until iTunes says its detected a device that needs to be updated or restored. Then restore.

  • Can someone tell me the process of ISE profiling

    Hi Cisco Guru,
    Can someone tell me the process ISE performs Profiling?
    For example, a new device plugs into switch port, what happens first, what will be sent to ISE for profiling purpose? Does ISE perform SNMP query immediately? If I enable Radius Probe, DHCP probe, SNMP query, which one happens and in what order?
    Thanks in advance.
    Antonio

  • Can someone tell me the best stylus to use with good note app.

    Can someone tell me the best stylus to use with good note app?

    I use the Jot Script stylus with Good Notes on a daily basis, and I'm realy satisfied. I recently did some videos to show how this works for me, you could check it out, and I hope it'll help you find the perfect stylus and app!
    https://www.youtube.com/user/AurelienChe

  • Can someone tell me the difference between a MC774ll/a and a MC958ll/a.

    Can someone tell me the difference between model numbers MC774ll/a and a MC 95811/a?

    This is not a difference between your Macbook Pro, but the keyboard key cap type (the small plastic squares for each on your keyboard) I think it has to do with what is printed on the modifier keys, but the difference is minor and the both seem to be compatible with the same models based on the links you posted.

  • CAN SOMEONE TELL ME THE PRICE OF THE MOTHERBOARD FOR G6-1200TU ?

    cAN SOMEONE TELL ME THE PRICE OF THE MOTHERBOARD FOR  G6-1200TU  ?

    Hi,
    Please try the following stores:
       http://h20141.www2.hp.com/hpparts/?cc=US&lang=EN&jumpid=hpr_r1002_usen
       http://partsurfer.hp.com/
    or the following seller:
       http://www.ebay.com.au/itm/HP-Pavilion-G4-G5-G6-G7-OEM-Laptop-Motherboard-636373-001-661148-203-6470...
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Can someone tell me the differences?

    Can someone please tell me the difference between the old apple tv and the new apple tv?! thanks!

    Got mine today in the mail.
    The new Apple TV only displays 720p in overscan mode (the old one would do 1080p without cutting off any pixels).
    The 720p resolution is fine for movies in 720p, but is noticeably poor in the user interface (looks fuzzy on 42+ inch LCD/Plasma TVs).
    The color profiles on the new Apple TV seem weird (photos look out of whack).
    The new Apple TV seems underpowered in the user interface with very evident lag and chunkiness.
    In particular, the new Apple TV does not render photo animations at 60fps like the old Apple TV (looks more like 30fps or even 15fps, noticeably choppy).
    Maybe these issues will be addressed with software optimizations in future firmware updates.
    I am an Apple fanatic, and love my old Apple TV, but I wouldn't recommend the new on yet. I plan to shelve the new one in favor of the old one for displaying my iTunes and iPhoto content on my TV.

  • Can someone tell me the *newest* model # for isight?

    Hi all,
    Can someone please tell me which is the newest model # (or the last model # Apple shipped) Was is the M9330LL/C or the M8817LL/C.
    Or maybe I am totally off?
    Thanks in advance guys!
    (if I have to go through ebay to get my isight (shame on you Apple) then I would at least like the latest release!)

    Thanks Ken and J.V. I appreciate it!
    j.v. - thanks a bunch, you told me everything I wanted to know!

  • Help. Can someone tell me the taxes on their triple bundle package in NYC

    Can someone with a bundle package fios tv, interenet and phone, the ~$94.99 plan tell me what the taxes are?  Basically what is the total cost of the bill per month is in NYC and if it is the same amount every month and if not how much it fluctuates.  I have looked everywhere and can't find the answer and Verizon can't tell me the number.
    Thanks

    OK.  Finally found the answer.  Thanks for all those that responded.
    Actually was able to get the triple play fios (20mps for internet), fios tv and phone for $84.99 (there was an additional discount of $10 if you order via phone).  After all applicable taxes the final bill comes to ~$102/month.  Free standard HD top box.  Hope this helps for others out there in NYC.  I assume if you were to go with the 94.99 the final bill would be ~$10 more.

  • Would Someone Please Post the Official Vista CD ON File Fr

    Would someone please post this on filefront so I can get it Please Thanks Regards WesMessage Edited by mickey3390 on 06-8-200703:8 PM

    :smileyvery-happy:Thanks again to you and all involved. Have you installed it yet and if so what were your results? I'll post my results tomorrow. Thanks again!!!!:smileyvery-happy:Message Edited by mickey3390 on 06-8-200704:3 PM

  • Can someone tell me the SIM Activation key / Code for my iPhone 3g (16-bit) ?

    I have iPhone 3G (8-bit mother board), there was a problem when just i have update the software of it, it is totally failed.. now i have changed his mother board from 8-bit to 16-bit, but now i am facing SIM activation problem so can any body tell me the activation key / code for it...? 

    If you bought the iphone in the US and it is locked to a specific carrier, then you can't use a different sim (from another carrier).  Is this your situation?
    Otherwise I'm not sure what you mean by "trying to unlock my SIM".  In which country did you buy the iphone?  Who's your carrier?

  • Would someone tell me where the customer complaint is?

    I have bought T520 5 months ago for 2000 pounds. 
    The rescue and recovery never works, the wifi stopped working after 3 weeks, and the computer can not be shutted down.
    To fix the problems, I upgraded my warranty from carry-in to on site, the worst part is I spent 2 weeks and 5 phone calls to upgrade my warranty, the first 2 calls provided me wrong e-mail address, which the custome service blamed this fault on me!
    I searched the entire website and can not find a place for customer complaint.
    So I was wondering if someone has found it or it doesn't exist at all.
    Thanks very much for information and advice in advance. 
    Solved!
    Go to Solution.

    Hi Cybabyfish,
    Having just done a quick search, i have come across this email address...
    [email protected]
    Doesn't seem much of a direct complaints line, but having searched, it would seem that many people are finding it difficult to get directly to the complaints team.
    The site I found though does give a telephone number as well...
    http://shop.lenovo.com/SEUILibrary/controller/e/we​b/LenovoPortal/en_US/special-offers.workflowhowPro...
    Hope that helps?
    Thanks
    Andrew

  • Would someone tell me something about multithread and multiprocessor

    Hey, would you be so kind to tell me something about how to progrmme with using multithread in multiprocessro? and where can I find something about it? My problem is that
    Assume that you have to write a computer program that will receive as input a single array
    storing a large number of integers. The program has to compute the prefix sums of the
    number sequence.
    Given a sequence of numbers x1, x2, ..., xn, the prefix sums are the partial sums:
    s1 = x1
    s2 = x1 + x2
    sn = x1 + x2 + ... + xn
    �You have to be prepared to write a program for program should be able to use a variable, user-specified, number of processors. For
    example, the user should be able to run the program using any number of processors P
    between 1 and 16. The number of processors P can either be selected using a command
    line argument or the program can prompt the user.
    �Your program should be able to sum a variable, user-specified, number of integers. The
    integers in the input sequence should be randomly generated inside your program. (That
    is, the user will input n, and the program will then randomly generate n numbers.)
    �Your program should print out (either to the standard output or to a file) in ascending
    order the prefix sums computed: s1, s2, �, sn.
    Can someone give me some help? I have no idea about how to do it?
    thanks a lot of

    I think perhaps you are asking about how to create threads in Java? I'm not sure, but I'll give you some background anyway. Basically all that you need to know is documented in the class java.lang.Thread. If you want a class to run on a separate thread then you can do one of two things:
    (a) define a class that extends Thread.
    (b) define a class that implements Runnable.
    I prefer the latter, but it's up to you. So, for example, if I have some computationally expensive algorithm to execute I would define a class like this:
    public class ImExpensive implements Runnable {
    ����public void run() {
    ��������<insert code here>
    ����}
    Then when you want to run the algorithm you do this:
    ����ImExpensive o = new ImExpensive();
    ����new Thread(o).start();
    The second line in this case constructs a thread that the object 'o' can run on (the start() method causes the run() method in the ImExpensive class to execute).
    Now, as for running on multi-processors, I have never done this so I am not too sure. But all that you have to do is figure out a way of associating the thread that was created with a particular processor.
    Also, be careful when using threads. Everything will be OK if your computations are mutually exclusive (ie: they aren't interdependent). If they aren't then you might run into what is sometimes called "the racehorse problem". This is a phenomenon that occurs because you can't guarantee which threads are going to finish first or indeed the order of interleaved operations. It's difficult to describe but this tutorial may help you out.
    http://java.sun.com/docs/books/tutorial/essential/threads/
    Hope that helps. :)
    Ben

Maybe you are looking for

  • Creation of purchase order using bapi

    hi gurus, Can anyone give me an example of how to create purchase order using bapi

  • Which is better for labview - 2000 or XP?

    I am upgrading an image acquisition system to LabVIEW 7 and was wondering what are the relative benefits, if any, of 2000 and XP (both Pro). I primarily use two 1422 boards to grab simultaneous images from two cameras at a rate of up to 60 Hz (320x25

  • ORA-01843 when db nls_date_format=MM/DD/YYYY

    RMAN> backup recovery files; Generates errors: RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: ===============================================

  • Pressing enter activating other buttons in VI

    Hi All, I have an app built based on the User Event Handler template. In it I have a graph and several buttons (so far). The odd behavior occurs when I edit an axis range on the graph during runtime. When I type in a new max val for an axis and press

  • HT3964 Macbook Pro not turning on and having no responses

    I just reset my MBP smc now it looks charging!! but still can not turning on the machine is there anything more that i can do myself before i take it to the store??