コード例 #1
0
  public void writeTo(OutputStream os) {
    if (!available()) {
      throw new IllegalStateException(MESSAGE_FILE_MOVED);
    }

    try {
      IoUtils.copy(new FileInputStream(diskFile), os);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
コード例 #2
0
 public String getFileContent(String charset) {
   if (!available()) {
     throw new IllegalStateException(MESSAGE_FILE_MOVED);
   }
   return IoUtils.toString(diskFile, charset);
 }