Closeable
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package net.runelite.cache.fs;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
@@ -7,7 +8,7 @@ import java.io.RandomAccessFile;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class IndexFile
|
||||
public class IndexFile implements Closeable
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(IndexFile.class);
|
||||
private static final int INDEX_ENTRY_LEN = 6;
|
||||
@@ -24,6 +25,12 @@ public class IndexFile
|
||||
this.idx = new RandomAccessFile(file, "rw");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException
|
||||
{
|
||||
idx.close();
|
||||
}
|
||||
|
||||
public synchronized void write(IndexEntry entry) throws IOException
|
||||
{
|
||||
idx.seek(entry.getId() * INDEX_ENTRY_LEN);
|
||||
|
||||
Reference in New Issue
Block a user