Say theres one file of X MB and I want to read it entirely and display the decimal value represented by these X MB of data. Can anyone guide me how to begin with.

[By decimal value I mean : all bits finally represent something in decimal; How can I convert X MegaBits to Deciaml value and perform arithmetic operations on this value]

Thanks in advance

When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.

I'm not sure whether i have understood u'r question fully ..

If u need a decimal value for each & every character in a file , why cant you use the ascii value of each character stored in the file . [ October 17, 2004: Message edited by: srini vasan ]

Are you perhaps talking about something like java.math.BigDecimal? On the other hand - if you want to get a number that somehow characterizes the content of a large file, perhaps you want something like a message digest - see java.security.MessageDigest Bill

Say theres file of size 1kb These 1024 bytes (1kb) = 1024*16 bits must be representing a final decimal value I need this decimal value and want to perform arithmetic computations on it.

Its easy to get that decimal value for small size file; for bigger files I used BIgInteger and somehow managed it. But after a fixed size I cannot sem to read entire file contents and get that final value maybe ram limitations

What I really want is that say theres a 2GB file then that file can be represented using a unique decimal(integer) value I just want to get that value but cant seem to...

Well, with 2GB of data, you're going to bump into hard limitations of many JVMs. Sun's Linux and Windows JVMs both have heap size limits somewhat below 2GB. Your only option for directly dealing with data of this size would be to go to another language -- C/C++, probably -- and a 64 bit architecture. You can certainly play games whereby only part of the data comes into memory at once, but that adds a lot to the complexity of your code.

I'm quite interested now -- what sort of work are you doing that involves integers with 2 billion digits?