Hi, please excuse me that this is more a java question, but still
related to imageJ 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? Thanks Hao ************************************************************************* 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. ************************************************************************* |
> 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 |
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. ************************************************************************* |
Free forum by Nabble | Edit this page |