File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Help in this 0x8FFFFFF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Help in this 0x8FFFFFF" Watch "Help in this 0x8FFFFFF" New topic
Author

Help in this 0x8FFFFFF

adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
Hi all.
In a program of MappedFiles i have seen this 0x8FFFFFF. It is used to specify the size of the file i.e 128 MB. How is that code generated and how can i get the code for different numbers. Can any body please help. More over i want to know the difference between file length and file size. I am confused because file length is also given in MB.


Thanks and Regards
alexander


Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

That's a number (150994943) in base-16, otherwise known as hexadecimal. Your calculator probably has a hexadecimal mode you can use to convert numbers; the Windows calculator accessory does, too.

File length and file size would both mean the same thing.


[Jess in Action][AskingGoodQuestions]
adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
Thanks a lot for replying.
Can i create a file without specifying the size? I have created one and wrote in that line by line i.e the out put is below

name0 Marks0
name1 Marks1
name2 Marks2
name3 Marks3
name4 Marks4
name5 Marks5
name6 Marks6
name7 Marks7
name8 Marks8
name9 Marks9
name10 Marks10



Now how can i delete a particular line from this.

Thanks in advance
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Sounds like you might be coming a mainframe background where "random access" files were the norm. Java's model of a file is just like the UNIX one: it's a sequence of bytes, nothing more, nothing less. The only way to delete a line from a file is to copy the file to new file, leaving out that line, deleting the original file, and renaming to new file to the old name.
 
 
subject: Help in this 0x8FFFFFF
 
Similar Threads
Missing characters with SAX Parser
get the resultant value upto 2 decimal places.
encrypt and decrypt a file of size about 10 mb
file transfer
Sending only 1mb of files from folder through web service.