Inserting data in RandomAccessFile and updating index
问题 I've got a RandomAccessFile in Java where i manage some data. Simplified: At the start of the file i have an index. (8 byte long value per dataset which represents the offset where the real data can be found). So if i want to now where i can find the data of dataset no 3 for example. I read 8 Bytes at offset (2*8). (Indexing starts with 0). A dataset itsself consists of 4 Bytes which represents the size of the dataset and then all the bytes belonging to the dataset. So that works fine in case