Fastest way for file modification?

Hi there all,
I am making a desktop swing application and i am abit confused, could you give some advice?
What i want to learn is Which way is fastest way for;
1. to read some data from file
2.to read whole data from file
3. to write data to file
4.to modify data in file
Way 1- Xml (sax, dom)
way 2, file i/O
Thanks.

Which way is fastest way forWhy are people always obsessed with "fastest". We don't have enough information to even begin to answer this question. We have no idea about the amount of data that is involved, but from your basic description it sounds to me like a database would be overkill. It takes milliseconds to read a file.
Based on your sample data, try starting with something simple, like using a Properties files.

Similar Messages

  • HT5192 What is the easiest and fastest way for me to get the iOS 5.1 update for my ipad2?

    What is the easiest and fastest way for me to get the iOS 5.1 update for my ipad2? I am non tech savvy and am a new user to apple devices.

    If you are already running iOS 5 on your iPad go to Setrings>General>aoftware Update and you can update over the air via WiFi. If you are not running iOS 5 you have to connect the iPad to your computer and update via iTunes.
    Instructions here.
    http://support.apple.com/kb/HT4623

  • Fastest Protocol for file transfers (mybook world)

    So I have this NAS hookd up to my network and it appears on my finder and great. I'm getting 2.5Mb max throughput.....but, I know there are various protocols to choose from, the default, i dunno.
    Since im optimizing for speed, which would be the best?
    * AFP
    * NFS
    * SMB
    Thanks,
    Paul

    If you are using 802.11g WiFi, then you will be luckly to get more than 3 to 3.5 megabytes/sec. While 802.11g is rated at 54megabits/sec, real world throughput comes in closer to 25'ish megabits/sec.
    This is under ideal WiFi connection conditions, with no WiFi repeaters, no interference from other 2.4GHz devices (cordless phones, neighbors, baby monitors, microwave ovens, and walls).
    As has been mentioned, a direct gigabit ethernet connection will give he best NAS performance.
    If you wish to remain wireless, then 802.11n using the 5GHz frequences, with the 802.11n base station set for maximum 802.11n performance, and it is a good 802.11n base station, then you can expect something in the 15 - 20 megabyte/sec range. Again under ideal conditions.
    As a base line, you should measure your NAS performance using a gigabit ethernet connection, so that you will know if there are any performance limitations on the NAS. For example, when I scp to trans fer to my Mac mini, if I am going to a USB external device, my performance drops to around 8 megabytes/sec because of the speed of that external device along with the network protocol overheads. But when I go to the internal 5400 rpm Mac mini, my performance is a little above 51 megabytes/sec. If I had a faster disk in the Mac mini, I might be able to do better.
    So get a baseline for your NAS, and then consider what options you have for better performance.

  • What's the fastest way to share files live between 2 Macs in the same room?

    Please can I have some advice on this scenario?
    I'll need to share HD video footage between 2 new Mac Pros in the same room. 1 Mac will be used to upload the footage and the other to edit it using FCP. The footage can be stored either on hard drives in the edit machine or on desktop hard drives connected to the edit machine (or if there is a better option I'm open to advice).
    What is the fastest way of sharing the files and what is the simplest way?
    Any suggestions would be greatly appreciated.
    Thanks in advance

    What is the fastest way of sharing the files and what is the simplest way?
    Fastest way? a fiber channel SAN connecting the two machines to a common fiber-channel based storage array. Can't beat it for performance, but it comes at a cost (think $20K as a starting point, depending on the amount of storage you need).
    Simplest way? Some external media (thumb drive, external hard drive, etc.) that you shuffle between the two machines
    Intermediate: a NAS-based storage box on your network, although be aware that real-time editing of HD video can overwhelm many low-end NAS boxes.

  • Fastest way to do a bitwise comparison of 2 large files

    Hello All,
    I have two relatively large files (memory dumps) of approx. 1 MB. Both files have the same size.
    I need to do a bitwise comparison of both the files. (one is the reference file, the other is the measured file)
    What is the fastest way of doing this? I need to know how many bitwise differences there are.
    I need to present the user with a percentage of how good the match between both files is and also the number of differences.
    Mayby later on I also need to list the differences.
    I was thinking about opening the files in binary mode, reading them out and converting them to boolean arrays and with the autoindexing of for-loops determining if there are differences. Probably there are much better ways for doing this.
    Your help is greatly appreciated!
    noxus.

    OK, here's a quick draft (LV 8.0) of what I meant. I assume you know how to read a file as U8 binary array, so let's start with two U8 arrays of equal length.
    The lookup table needs to be calculated only once, then you can replace it with a diagram constant. Still, it is very cheap to do.
    I doubt you can count the number of bit differences much faster that this.
    DIsplay all arrays in binary so you see what's going on. (# of differences" should probably be labeled # of bitwise differences").
    Message Edited by altenbach on 02-14-2007 02:50 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    CountBitDifferences.png ‏8 KB
    CountBitDifferences.vi ‏13 KB

  • Is this the fastest way to copy files?

    I'm looking for a way to take 1 file and make many copies of it. Is this fastest way you know of?
    import java.io.*;
    import java.nio.channels.*;
    public static void applyFiles( File origFile, File[] files )
      FileInputStream f1 = new FileInputStream( origFile.getAbsolutePath() );
      FileChannel source = f1.getChannel();
      FileOutputStream f2[] = new FileOutputStream[ files.length ];
      FileChannel target;
      for( int x=0; x < files.length; x++ )
        if( origFile.getAbsolutePath() != files[x].getAbsolutePath() )
          f2[x] = new FileOutputStream( files[x].getAbsolutePath() );
          target = f2[x].getChannel();
          source.transferTo(0, source.size(), target);
    }

    2 questions from your code...
    1) I assume the last line should read
    out.write(buffer,0,numRead);
    2) Doesnt this just read in a piece at a time and write that piece to each file? Isn't that degrading performance to have so many files open and waiting at once? Would it make more sense to read into a StringBuffer, then write all the data to each file at a time?
    Thanks
    I'd have to say that your question is loaded. :)
    Without knowing anything about your target system, I'd
    have to say no, this is not the fastest way to copy a
    file to many files. This will end up reading the file
    once for every time you want to copy it. Which may
    work fine if the file is small, but not when the file
    that is being copied is larger then free ram. Or if
    the file channel implementation sucks.
    For the general case, where you don't know how big the
    file will be beforehand I'd say that this is a better
    algorithim.
    public static void oneToManyCopy( File source, File[]
    dest ) throws Exception(s) {
    FileInputStream in = new FileInputStream( source );
    FileOutputStream out[] = new
    w FileOutputStream[dest.length];
    for ( int i = 0 ; i < dest.length;++i)
    out[i] = new FileOutputStream(dest);
    byte buffer[] = new byte[1024]; // or whatever size
    e you like
    int numRead;
    while ( ( numRead = in.read(buffer,0,buffer.length)
    ) ) > -1 ) {
    for ( int i = 0 ; i < out.length; ++i )
    out.write(buffer,0,numRead);

  • I accidentally formatted my portable hard drive when setting it up for time machine. Is there any way for me to get back my lost files?

    I have an external hard drive of the brand Western Digital.
    Before I got my iMac I moved a lot of my important files from my PC to the hard drive and today I went on and connected it to my iMac to move my files over to it.
    When it had connected a window popped up that asked if I wanted to use this hard drive with the program Time Machine and create backups. Without thinking it trough enough and reading the warning properly (I'm stupid I know) I clicked "yes". I then realised how stupid it was and cancelled the formatting of the hard drive. But somehow the program still managed to delete all my important files and can't find any way to get them back. Neither can I connect the hard drive to my PC anymore so I can't check if the files are still there (which I doubt they are since I can't see them on my iMac either).
    And now I wonder: is there any way for me to get back my lost files or are they lost forever?
    Thank you in advance!
    //Gina

    A data recovery specialist or some data recovery programs should be able to help.  Most format simply rewrite the directory tree saying no files are on this disk.  The bits that represent the files are still flipped appropreiately so they still exists, you just don't have the location info to get at them.  Secure formats and erases rewrite each bit to a zero or 1 or random so the data is then truely gone.  This type of format takes a long time to complete.
    I'm not making a recomendation of a particular program but here is one company that does what you ask:
    http://www.remosoftware.com/mac-recovery  The cost is pretty high but I'm sure they don't sell many copies and need to cover their development costs.
    Good luck and don't write anything on the freshly formatted disk until you decide what to do.

  • My home network has an Airport Extreme w/Time Capsule as the base and then an Airport Express and a second Airport Extreme to reach different areas of the house.  Is there a way to use the second Airport Extreme for file storage on this network?

    My home network has an Airport Extreme w/Time Capsule as the base and then an Airport Express and a second Airport Extreme to reach different areas of the house.  Is there a way to use the second Airport Extreme for file storage on this network?  Network is administered through an iMac running OS X Yosemite 10.10.2.  Ideally, would like for the second Airport Extreme hard drive to appear on the list of devices in the Finder window.

    Ok.. gottcha
    The problem is network wise.. Yosemite is about equal to tin cans and string.. pathetic.
    Here is my usual set of instructions to get anything working on Yosemite.
    The best way to fix problems is a full factory reset of all the AE in the network.
    Factory reset universal
    Power off the AE.. ie pull the power cord or power off at the wall.. wait 10sec.. hold in the reset button.. be gentle.. power on again still holding in reset.. and keep holding it in for another 10sec. You may need some help as it is hard to both hold in reset and apply power. It will show success by rapidly blinking the front led. Release the reset.. and wait a couple of min for the AE to reset and come back with factory settings. If the front LED doesn’t blink rapidly you missed it and simply try again. The reset is fairly fragile in these.. press it so you feel it just click and no more.. I have seen people bend the lever or even break it. I use a toothpick as tool.
    Then redo the setup from the computer with Yosemite.
    1. Use very short names.. NOT APPLE RECOMMENDED names. No spaces and pure alphanumerics.
    eg AEgen5 and AEwifi for basestation and wireless respectively.
    Even better if the issue is more wireless use AE24ghz and AE5ghz with fixed channels as this also seems to help stop the nonsense.
    2. Use all passwords that also comply but can be a bit longer. ie 8-20 characters mixed case and numbers.. no non-alphanumerics.
    3. Ensure the AE always takes the same IP address.. this is not a problem for AE which is router.. it is a problem for AE which is bridged.. you will need to set static IP in the main router by dhcp reservations or use static IP in the AE which is tricky.
    4. Check your share name on the computer is not changing.. make sure it also complies with the above.. short no spaces and pure alphanumeric..
    5. Make sure IPv6 is set to link-local only in the computer. For example wireless open the network preferences, wireless and advanced / TCP/IP.. and fix the IPv6. to link-local only.
    6. Now mount the disk of the second AE in finder... manually.
    Use Go, Connect to Server and type in the AE ip address.
    SMB://10.0.1.2
    Where you will replace that address with the actual address. The network resource should be discovered and then it will request the password.. type that in and make sure you tick to save it in your keychain.
    There is a lot more jiggery pokery you can try but the above is a good start.. if you find it still unreliable.. don't be surprised.
    Do as much as you want of the above... not all of it is necessary.. only if you want it reliable.. or as reliable as Yosemite in its current incarnation can manage.
    The most important thing is point 6.. mount the disk using direct IP address and not names.. dns in Yosemite is fatally flawed.
    See http://arstechnica.com/apple/2015/01/why-dns-in-os-x-10-10-is-broken-and-what-yo u-can-do-to-fix-it/

  • Is there any way for me to get my music off of my iPod?  I had to get a new computer and no longer have my files...but most are cds

    Is there any way for me to get my music off of my iPod? I had to get a new computer and no longer have my files, most of it is cds...

    Your iPod can only be synced with one computer at a time.  If you try to sync it with a new computer/iTunes library, it will replace the contents of the iPod with whatever is in the new library. You should probably disable the autosync functionality first by going to Edit -> Preferences, clicking the Devices tab, and enabling the prevent iPods,iPhones, and iPads from automatically syncing option.
    Before doing anything else,  authorize the new computer with your iTunes Account.  In iTunes, choose Store -> Authorize This Computer and enter in the correct credentials. Either copy a backup file from your old computer to your new one or create a new backup of your iPod in iTunes before letting it sync.
    Then right->click on your iPod Touch from under the Devices section in the left hand pane of iTunes and choose Backup. You might also want to take a look at this article to see what it all included in the backup.
    iOS: How to back up
    Now onto synced content such as music, videos, photos, etc.  For iTunes purchases you can copy them back into iTunes by choosing File -> Transfer Purchases.  For all other nonpurchased iTunes content, see this excellent user tip from another forum member turingtest2 outlining the different methods and software available to help you copy content from your iPod back to your PC and into iTunes.
    Recovering your iTunes library from your iPod or iOS device
    Once the backup has been made and all other synced content such as music, videos, and photos are back in your iTunes library, restore your iPod from that backup you made earlier.  Here is more on backing up and restoring your iPod.
    iTunes: Backing up, updating, and restoring iOS software
    If you do happen to lose any purchased content, you can always redownload it from the iTunes Store again at no cost via iCloud.  See this article for information.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    B-rock

  • Any way to set up iWeb pages for file download / sharing?

    I have been using .Mac Homepage to set up several web pages to share audio files with my clients. I have been able to set up a different web page for each client, each with their own password, with files there for them to download.
    Is there a way to duplicate this using iWeb now that .mac homepage sites are going away? I don't want the audio to stream, I just want to make the files available for downloading, and don't see any page templates in iWeb '08 for file downloading.
    I know that I can use mobileme's new file sharing feature to email links to individual files, but this doesn't work as well as having all the files downloadable on one or more web pages.

    If you have all of the sites in one domain file you should be able to upload only the changed pages but it's been a while since I used 08 so don't remember. You can move each site into its own domain file so that only that site is edited and published. And if you're publishing directly to mobile me only the edited files should be uploaded.
    I use iWebSites to manage over 75 individual sites.. It lets me create multiple sites and multiple domain files.
    If you have multiple sites in one domain file here's the workflow I used to split them into individual site files with iWebSites. Be sure to make a backup copy of your original Domain.sites files before starting the splitting process and move it to another location on your HD until you're satisfied the separation process is completed and what you want.
    This lets me edit several sites and only republish the one I want. Make sure you're running the lastest version of iWeb, 2.0.4 I believe.
    An example of files set up for immediate download is Toad's Cellar. Each linked is linked to a zipped file which downloads when clicked on. The site could be password protected if so desired.
    OT

  • Is there an automated way to scan my multimedia folder for files that are there and not in my library and add them ?

    Is there an automated way to scan my multimedia folder for files that are there and not in my i tune library and add them to y existing library ?
    I recenty had a damaged i tune library and had to import an old version.
    This last one does not have many of the CD I have copied the past months. And I don't know which ones these are either as they are too many of them.

    This will list files that are in the iTunes DB but the files are not in the media folder…
    http://dougscripts.com/itunes/scripts/ss.php?sp=listmias
    This will list files that are in the media library, but not in the iTunes DB.
    http://dougscripts.com/itunes/scripts/ss.php?sp=musicfolderfilesnotadded2
    I think it may misbehave with ringtones & some of the obscure media files, but they are both really powerful for repairing mangled libraries.
    I would create a new smart playlist for 'Tracks added since (todays date)' so you can easily find any tracks that you add back to iTunes.
    Doug has a lot of scripts for iTunes, spread the karma & donate if they are useful to you

  • Fastest way to write array of million longs to file

    Hi,
    I have an array of 200 million longs. What is the fastest way to write this array to a file, so that I can read it back later. I tried looping, but that is too slow.
    Thanks,
    Taran

    Maxideon wrote:
    Can't he store a portion of those longs into a very large byte array, write the array, and then rinse and repeat? This would increase size of the file writes and should spead up the time...It's still looping. Simply using buffering will decrease the I/O overhead significantly. No need to munge pre-I/O buffering ourselves.

  • Is there a way for mac to turn a voice file into text?

    is there a way for mac to turn a voice file into text?

    Mt Lion has dictation. I've had some luck using that and my iPhone voice memo program transcribing. It works best when the memo's are a minute or less and obviously there's editing to do afterwards.

  • What is the fastest way to transfer files and applications from an older iMac to a new MacBook Pro?

    What is the fastest way to transfer files and applications from an older iMac to a new MacBook Pro?
    I have a Firewire cable and Thunderbolt adapter, but no icons showing either Mac appear on either desktop.

    The fastest way is to use Carbon Copy Cloner and a external drive formatted GUID OS X Ext. J in Disk Utlilty, then connecting to the new Mac and using Migration Assistant in the Utilites folder.
    Even faster, if you can determine your going to replace all the apps from fresh sources anyway (like if the older Mac's OS X verison is old thus the apps) then just use a external drive and copy just your files to it, then connect to the new Mac and transfer over.
    Some apps you can just grab the registration code and install it fresh on the new machine with the old code, talk to the developer about transfering the program, as long as it's deleted on the older Mac in the process.
    It used to be Firewire Target disk mode was fastest, but since Thunderbolt came out...
    Notice this support doc hasn't been updated since june 2012, no Thunderbolt info
    https://support.apple.com/kb/HT1661

  • Ichat auto accept for file transfer?  way to combine buddy lists?

    1) on the new leopard ichat, is there an auto-accept mode for file transfers so that anyone on my buddy list can automatically send me files?
    2) i have a google chat and aim accounts running. they run on separate buddy lists. is there a way to combine them to only have one buddy list window?

    You can actually. Go to iChat > Preferences > Alerts, select "Incoming File Transfers" from the pull-down menu, check "Run AppleScript", select "Auto Accept.applescript". Your file transfers will be accepted by default

Maybe you are looking for

  • Kernel panic mac pro osx 10.4.10 - please help

    I have tested the ram with remember and run apple hardware checks on the disk and everything seems OK. Can anybody help me? Here are the log entries. Wed Oct 22 20:13:45 2008 Machinne-cc caklitipati0xite Wed Oct 22 20:20:04 2008 Machine-cchc k caapai

  • Warning on DiskWarrior

    Unfortunately I didn't check if there was an update before using it on my Snow Leopard drive. It reported many errors and I had it fix them. I couldn't boot from the SL disk again. Some many hours later all is right again, eventually I just restored

  • Camera stays in video mode how do I change to take photos

    Need help changing camera from video to photo!

  • Problem with rwclient

    I am having a problem with printing character reports using rwclient. We have a stored procedure that calls rwclient to generate a file and then we issue a host command and print the file. In the form itself there are updates before and after the cal

  • I just got a brand new iphone 4, and itunes says it cannot read the contents of the iphone, please restore..

    Ive update itunes, restored iphone, and liver support is closed. does anyone know a fix. the sim card has been verified by o2 customer services, and they insist its an apple issue.. please if anyone has help let me know. N