Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int getAddressFromIndex(int index) throws IOException {
- int tIndex = 0;
- for(int n = 0; n < 32; n++) {
- channel.position(tIndex);
- ByteBuffer buf = ByteBuffer.allocate(8);
- channel.read(buf);
- buf.rewind();
- int i1 = buf.getInt();
- int i2 = buf.getInt();
- tIndex = ((index & (1 << (31 - n))) != 0) ? i2 : i1;
- if(tIndex == 0) {
- return 0;
- }
- }
- return tIndex;
- }
Advertisement
Add Comment
Please, Sign In to add comment