java.io.RandomAccessFile.flush()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(236)

本文整理了Java中java.io.RandomAccessFile.flush方法的一些代码示例,展示了RandomAccessFile.flush的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RandomAccessFile.flush方法的具体详情如下:
包路径:java.io.RandomAccessFile
类名称:RandomAccessFile
方法名:flush

RandomAccessFile.flush介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

public void close () throws IOException {
  if (data != null) {
    flush();
    data = null;
  }
}

代码示例来源:origin: libgdx/libgdx

public void close () throws IOException {
  if (data != null) {
    flush();
    data = null;
  }
}

代码示例来源:origin: libgdx/libgdx

public void flush () throws IOException {
  file.flush();
}

代码示例来源:origin: libgdx/libgdx

public void flush () throws IOException {
  file.flush();
}

代码示例来源:origin: libgdx/libgdx

public RandomAccessFile (File file, String mode) throws FileNotFoundException {
  name = file.getCanonicalPath();
  mode = mode.toLowerCase();
  if (!mode.equals("r") && !mode.equals("rw")) {
    throw new IllegalArgumentException("mode: '" + mode + "'");
  }
  writeable = mode.equals("rw");
  if (file.exists()) {
    data = atob(File.LocalStorage.getItem(name));
    len = data.length();
  } else if (writeable) {
    data = "";
    dirty = true;
    try {
      flush();
    } catch (IOException e) {
      throw new FileNotFoundException("" + e);
    }
  } else {
    throw new FileNotFoundException(name);
  }
}

代码示例来源:origin: libgdx/libgdx

public RandomAccessFile (File file, String mode) throws FileNotFoundException {
  name = file.getCanonicalPath();
  mode = mode.toLowerCase();
  if (!mode.equals("r") && !mode.equals("rw")) {
    throw new IllegalArgumentException("mode: '" + mode + "'");
  }
  writeable = mode.equals("rw");
  if (file.exists()) {
    data = atob(File.LocalStorage.getItem(name));
    len = data.length();
  } else if (writeable) {
    data = "";
    dirty = true;
    try {
      flush();
    } catch (IOException e) {
      throw new FileNotFoundException("" + e);
    }
  } else {
    throw new FileNotFoundException(name);
  }
}

代码示例来源:origin: thothbot/parallax

public void close () throws IOException {
  if (data != null) {
    flush();
    data = null;
  }
}

代码示例来源:origin: thothbot/parallax

public void flush () throws IOException {
  file.flush();
}

代码示例来源:origin: thothbot/parallax

public RandomAccessFile (File file, String mode) throws FileNotFoundException {
  name = file.getCanonicalPath();
  mode = mode.toLowerCase();
  if (!mode.equals("r") && !mode.equals("rw")) {
    throw new IllegalArgumentException("mode: '" + mode + "'");
  }
  writeable = mode.equals("rw");
  if (file.exists()) {
    data = atob(File.LocalStorage.getItem(name));
    len = data.length();
  } else if (writeable) {
    data = "";
    dirty = true;
    try {
      flush();
    } catch (IOException e) {
      throw new FileNotFoundException("" + e);
    }
  } else {
    throw new FileNotFoundException(name);
  }
}

相关文章