Login  Register

Re: a java question

Posted by Hao Jiang-3 on Aug 01, 2008; 10:07pm
URL: http://imagej.273.s1.nabble.com/a-java-question-tp3695471p3695473.html

Thanks


Hao


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Albert Cardona
Sent: Thursday, July 31, 2008 6:08 PM
To: [hidden email]
Subject: Re: a java question

>  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




*************************************************************************
PRIVILEGE AND CONFIDENTIALITY NOTICE:

The information in this email is intended for the named recipients only.
It may contain privileged and confidential information.  If you have
received this communication in error, any use, copying or dissemination
of its contents is strictly prohibited.  Please erase all copies of the
message along with any included attachments and notify Intermap
Technologies or the sender immediately by telephone at the number
indicated on this page.

*************************************************************************