Add basic store object

This commit is contained in:
Adam
2015-10-12 21:16:03 -04:00
parent 57a55d43e1
commit 50a30553b9
5 changed files with 19 additions and 7 deletions

View File

@@ -15,12 +15,14 @@ public class DataFile implements Closeable
private static final int SECTOR_SIZE = 520;
private final Store store;
private final int datafileId;
private final RandomAccessFile dat;
private final byte[] readCachedBuffer = new byte[SECTOR_SIZE];
public DataFile(int id, File file) throws FileNotFoundException
public DataFile(Store store, int id, File file) throws FileNotFoundException
{
this.store = store;
this.datafileId = id;
dat = new RandomAccessFile(file, "rw");
}

View File

@@ -12,12 +12,14 @@ public class IndexFile
private static final Logger logger = LoggerFactory.getLogger(IndexFile.class);
private static final int INDEX_ENTRY_LEN = 6;
private int indexFileId;
private RandomAccessFile idx;
private final Store store;
private final int indexFileId;
private final RandomAccessFile idx;
private final byte[] buffer = new byte[6];
public IndexFile(int indexFileId, File file) throws FileNotFoundException
public IndexFile(Store store, int indexFileId, File file) throws FileNotFoundException
{
this.store = store;
this.indexFileId = indexFileId;
this.idx = new RandomAccessFile(file, "rw");
}

View File

@@ -0,0 +1,5 @@
package net.runelite.cache.fs;
public class Store
{
}