Editing a 1MB file continuously, what's more efficient?
        Posted  
        
            by kmels
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by kmels
        
        
        
        Published on 2010-05-15T19:20:14Z
        Indexed on 
            2010/05/15
            19:24 UTC
        
        
        Read the original article
        Hit count: 245
        
I've to be continuously editing a 1MB file, simulating a file system. I've to modify the directory of File Control Blocks, FAT, blocks, etc.
Proffesor recommended overwriting the file every time an update is made. 1MB shouldn't take minutes to do that, but I don't like this way.
Is it a FileChannel the way to go here? Also, I understand that if I edit a MappedByteBuffer, the content of the mapped file region is also edited immediately? i.e. is reflexive mapped?
Thanks.
© Stack Overflow or respective owner