本文整理汇总了Java中com.intellij.util.io.RandomAccessDataFile.length方法的典型用法代码示例。如果您正苦于以下问题:Java RandomAccessDataFile.length方法的具体用法?Java RandomAccessDataFile.length怎么用?Java RandomAccessDataFile.length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.io.RandomAccessDataFile
的用法示例。
在下文中一共展示了RandomAccessDataFile.length方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DataTable
import com.intellij.util.io.RandomAccessDataFile; //导入方法依赖的package包/类
public DataTable(final File filePath, final PagePool pool) throws IOException {
myFile = new RandomAccessDataFile(filePath, pool);
if (myFile.length() == 0) {
markDirty();
}
else {
readInHeader(filePath);
}
}
示例2: AbstractRecordsTable
import com.intellij.util.io.RandomAccessDataFile; //导入方法依赖的package包/类
public AbstractRecordsTable(final File storageFilePath, final PagePool pool) throws IOException {
myStorage = new RandomAccessDataFile(storageFilePath, pool);
if (myStorage.length() == 0) {
myStorage.put(0, new byte[getHeaderSize()], 0, getHeaderSize());
markDirty();
}
else {
if (myStorage.getInt(HEADER_MAGIC_OFFSET) != getSafelyClosedMagic()) {
myStorage.dispose();
throw new IOException("Records table for '" + storageFilePath + "' haven't been closed correctly. Rebuild required.");
}
}
}