Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Large File Support (http://www.velocityreviews.com/forums/t126669-large-file-support.html)

Chris Bentz 09-13-2003 08:32 PM

Large File Support
 
Anyone have any pointers on Large File Support (i.e. > 2 GB).

java.io.File.Length() is a long, 32bit, and will not return the size
properly.

Thanks in Advance,
Chris.



Marco Schmidt 09-13-2003 09:21 PM

Re: Large File Support
 
Chris Bentz:

>Anyone have any pointers on Large File Support (i.e. > 2 GB).
>
>java.io.File.Length() is a long, 32bit, and will not return the size
>properly.


length() returns a long, but that is always 64 bits large in Java.

If it really does not return a correct size for large files you have
probably found a bug.

Regards,
Marco
--
Please reply in the newsgroup, not by email!
Java programming tips: http://jiu.sourceforge.net/javatips.html
Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html

Chris Bentz 09-13-2003 09:29 PM

Re: Large File Support
 
Oh. Ok - then I have no problems. Thanks.

Chris.

"Marco Schmidt" <marcoschmidt@geocities.com> wrote in message
news:dg27mvs9hntut1ofbhgsda4773ssd3i2ro@4ax.com...
> Chris Bentz:
>
> >Anyone have any pointers on Large File Support (i.e. > 2 GB).
> >
> >java.io.File.Length() is a long, 32bit, and will not return the size
> >properly.

>
> length() returns a long, but that is always 64 bits large in Java.
>
> If it really does not return a correct size for large files you have
> probably found a bug.
>
> Regards,
> Marco
> --
> Please reply in the newsgroup, not by email!
> Java programming tips: http://jiu.sourceforge.net/javatips.html
> Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html




=?ISO-8859-1?Q?Daniel_Sj=F6blom?= 09-13-2003 09:31 PM

Re: Large File Support
 
Chris Bentz wrote:

> Anyone have any pointers on Large File Support (i.e. > 2 GB).
>
> java.io.File.Length() is a long, 32bit, and will not return the size
> properly.
>
> Thanks in Advance,
> Chris.


Long is 64 bits. Are you sure your filesystem can handle files larger
than 2 Gb?
--
Daniel Sj÷blom


Tor Iver Wilhelmsen 09-13-2003 10:21 PM

Re: Large File Support
 
"Chris Bentz" <cbentz@tbaytel.net> writes:

> Oh. Ok - then I have no problems. Thanks.


Also if you can use java.nio.* (JRE 1.4.x and later), look at
java.nio.channels.FileChannel and related classes.

Roedy Green 09-13-2003 11:58 PM

Re: Large File Support
 
On Sat, 13 Sep 2003 16:32:07 -0400, "Chris Bentz" <cbentz@tbaytel.net>
wrote or quoted :

>java.io.File.Length() is a long, 32bit, and will not return the size
>properly.


a long is 64 bits. That ought to handle any file I've ever heard of.

see http://mindprod.com/jgloss/primitive.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Brad BARCLAY 09-14-2003 01:10 AM

Re: Large File Support
 
Chris Bentz wrote:
> Anyone have any pointers on Large File Support (i.e. > 2 GB).
>
> java.io.File.Length() is a long, 32bit, and will not return the size
> properly.


A long in Java is 64 bits, but the problem is a lot more complicated
than that.

There are a few issues that need to be addressed within the JRE to
properly handle such large files:

1) Does the underlying filesystem support files this large? Many less
recent filesystems don't.

2) Is the JRE using the correct OS APIs to handle large files? As the
concept of filesystems being able to handle such large files is fairly
recent, many of the core APIs are build around 32 bit integer values.
In order to retain backward compatibility, many OS's, instead of
changing the existing API calls that are using 32 bit ints, added new
calls that support 64 bit ints. If the JRE is still using the original
API, and not the newer 64-bit capable calls, then even if you have a
64-bit enabled filesystem you're still not going to be able to handle
large files.

HTH!

Brad BARCLAY

--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project: http://www.jsyncmanager.org




All times are GMT. The time now is 05:33 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.