If you create a thick client, you at least get the chance to get some more face time with the users, for advertising or some other revenue model, since you will probably be paying in the hundreds of thousands of dollars to host such a service. The problem with the applet approach mentioned is that unless you have the end user modify their java security properties your applet will not have permission to save to the hard drive. I think that if it is a signed app it can get the extra permission to write to the hard drive.
This is not too different from the download an exe approach. The problem with this is that the user has to have the correct version of Java installed and has to have the Java Web Start capability setup correctly. Are users with restrictive firewalls like that likely to be permitted to install and run a. Take a look at cURL. This article describes how to do a multi-part simultaneous download via HTTP. Set it as high as the OS allows and you should see up to 2x improvement depending on your physical network.
Your mileage may vary. Edit: What exactly is this you're trying to accomplish? Who is the audience? I'm assumed for a bit that you're looking to do this over your own network; but you seem to imply the client side is someone on the internet. I think we need clearer requirements. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Large File Download Ask Question. Asked 13 years, 2 months ago.
Active 2 years, 6 months ago. Viewed 7k times. Improve this question. Rov 1 1 silver badge 10 10 bronze badges. TonyB TonyB 3, 2 2 gold badges 23 23 silver badges 22 22 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. Edit: TonyB is it limited to port 80? Please don't use ActiveX I am so sick of sites that are only viewable in IE. While I appreciate the sensitivity around IE-only solutions, I'd suggest the same level of sensitivity around Windows-only solutions unless you meant.
Can you split the files into pieces and then rejoin them after the download? If you don't want to write java code in-house, there are commercial applet solutions available: Vault MyDownloder Both of them have eval versions that you can download and test. Edmund Tay Edmund Tay 1, 1 1 gold badge 11 11 silver badges 10 10 bronze badges. A few ideas: Blizzard use a light-weight. I'm not entirely sure how it is done, but it looks like a branded version of the official BitTorrent client.
See S3 documentation. John Oxley John Oxley I say click-once installed download manager, similar to msdn. DevelopingChris DevelopingChris I would recommend the exe approach as it will be the easiest for the non-technical users to use. John Meagher John Meagher There are some users that will be behind corporate firewalls that don't permit FTP Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast what if you could invest in your favorite developer?
Who owns this outage? Building intelligent escalation chains for modern SRE. The file is a normal text file. I tried BufferedReader and BufferedWriter but it doesn't seem to be the best option.
It takes about 35 seconds to read and write a file of size 0. I think the bottleneck here is writing as reading alone takes about 10 seconds. I tried to read array of bytes, but then searching for lines in each array that was read takes more time. I suspect your real problem is that you have limited hardware and what you do is software won't make much difference. If you have plenty of memory and CPU, more advanced tricks can help, but if you are just waiting on your hard drive because the file is not cached, it won't make much difference.
Try running the following to see at what point your system is unable to cache the file efficiently. The default buffer sizes are not documented, but at least in the Oracle VM they are characters, which won't bring much performance advantage. When benchmarking the different copy methods, I have however much larger differences duration between each run of the benchmark than between the different implementations.
On my hardware, copying a 1GB text file line by line using BufferedReader and BufferedWriter takes less than 5s in some runs and more than 30s in other. I would recommend looking at the classes in the java.
Non-blocking IO might be faster for sockets:. I have a written an extensive article about the many ways of reading files in Java and testing them against each other with sample files from 1KB to 1GB and I have found the following 3 methods were the fastest for reading 1GB files:. It reads the file line by line not in bulk. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 9 years ago. Active 2 years, 7 months ago. Viewed 70k times. Any suggestions please? Improve this question. Peter Lawrey k 73 73 gold badges silver badges bronze badges.
See also Best way to read a text file — DNA. What encoding are you using in those files? What is your system default Charset? Add a comment. Active Oldest Votes. Took 0. Improve this answer. Peter Lawrey Peter Lawrey k 73 73 gold badges silver badges bronze badges.
The results of such a benchmark are more or less useless. First of all, when writing a file, closing the output stream does not ensure that all data has been written physically to the disk. It may still lurk around in a memory buffer on the OS level or on the harddisk. If you read the exact same file directly after you have written it, the data will most likely be read from a memory buffer and not physically from disk.
I tried the code and the speed is fast. Peter — user Your comments are terrific, jambjo. It'd be great to see an answer from you, since you're obviously knowledgable.
It has no idea whether the data is written to disk or even if you have a HDD.
0コメント