Examples of IRandomAccessFile


Examples of net.sf.joafip.file.service.IRandomAccessFile

    } else {
      this.cachePageSize = 0;
    }
    this.file = fileAccessParameter.getFile();
    if (this.useCache) {
      final IRandomAccessFile randomAccessFileDirect = newRandomAccessFile(fileAccessParameter);
      try {
        randomAccessFile = new RandomAccessFileReadWriteCache(
            randomAccessFileDirect,
            fileAccessParameter.getPageSize(),
            fileAccessParameter.getMaxPage());
View Full Code Here

Examples of net.sf.joafip.file.service.IRandomAccessFile

  }

  private IRandomAccessFile newRandomAccessFile(
      final FileAccessParameter fileAccessParameter) throws HeapException {
    try {
      final IRandomAccessFile randomAccessFile;
      switch (fileAccessParameter.getFileAccessMode()) {
      case RANDOM_FILE_ACCESS:
        randomAccessFile = new RandomAccessFileDirect(file,
            fileAccessParameter.getMaxRetry(),
            fileAccessParameter.getRetryMsDelay());
View Full Code Here

Examples of net.sf.joafip.file.service.IRandomAccessFile

  public BlockDataManager(final int pageSize, final int maxPage,
      final int blockLength) throws HeapException {
    super();
    final File file = new File("runtime/data");
    final IRandomAccessFile drandomAccessFile = new RandomAccessFileDirectNio(
        file, 0, 0);
    try {
      randomAccessFile = new RandomAccessFileReadWriteCache(
          drandomAccessFile, pageSize, maxPage, true);
    } catch (FileIOException exception) {
View Full Code Here

Examples of net.sf.joafip.file.service.IRandomAccessFile

    dataAccessSession.close(EnumFilePersistenceCloseAction.SAVE);
    filePersistence.close();
  }

  private void assertDataAndBackupAreSame() throws FileIOException {
    final IRandomAccessFile randomAccessFile = new RandomAccessFileDirectNio(
        new File(dataFile), 1, 0);
    final SortedMap<Integer, Integer> diffMap = new TreeMap<Integer, Integer>();
    final boolean differs = randomAccessFile.differs(backupFile, diffMap);
    if (differs) {
      LOGGER.error("differs\n" + diffMap.toString());
    }
    assertFalse("file content must be same", differs);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.