Read a WyilFile from the file system. @param id @param dir @param filename @return @throws IOException
(File dir, Trie path)
| 259 | * @throws IOException |
| 260 | */ |
| 261 | public static WyilFile readWyilFile(File dir, Trie path) throws IOException { |
| 262 | // First, determine filename |
| 263 | String filename = path.toNativeString() + ".wyil"; |
| 264 | // Second Read the file |
| 265 | try (FileInputStream fin = new FileInputStream(new File(dir, filename))) { |
| 266 | return new WyilFileReader(fin).read(); |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | /** |
| 271 | * Write a given WyilFile to disk using the given directory as a root. |