Normal ways of accessing files like reading data via the DataInputStream( which then contains a FileInputStream), only allows sequential reading from the file with things like readDouble(), or readInt(). Nowhere is there a way to read data from an arbitrary location like readInt(int offset). Nor is there a seek(int offset) function to set an pointer for the next read operation. This will cause trouble when reading from any but the simplest of file types. You see, many file types have fields that contain offsets to other structures in the file. These can't be read sequentially, because after reading an offset, you need to seek to that offset and then start reading from there. But you can't do that it seems in Java, at least not when using DataInputStream. What would be the correct way (if it's at all possible in Java) to do this in Java?