Login  Register

Re: a java question

Posted by Albert Cardona on Aug 01, 2008; 12:07am
URL: http://imagej.273.s1.nabble.com/a-java-question-tp3695471p3695472.html

>  In my plugin it needs to open big, binary file (32bit image) about 1g
>  size, of course won't open whole file, so I use java.nio filechannel,
>  which can move the "position" to the start point then "map" the size of
>  data into memory. It works very well, very fast.
>
>  Now I was asked if it can handle file size >2g. since the working
>  environment is pure 32bit, I'm not sure about this. I don't have test
>  data yet, and I tried to read some file >2g, no error message, but it
>  hard to tell if has reached the end.
>
>  Anyone knows that?



If the java.nio filechannel is using a small buffer that simply iterates
over the entire file, at any given time only a memory chunk the size of
the buffer is needed in RAM.

So 32-bit should read files over 2 Gb without problems.

Albert
--
Albert Cardona
http://www.mcdb.ucla.edu/Research/Hartenstein/acardona