MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / Dictionary

Method Dictionary

src/org/albite/dictionary/Dictionary.java:40–67  ·  view source on GitHub ↗
(final String filename)

Source from the content-addressed store, hash-verified

38 private String language;
39
40 public Dictionary(final String filename)
41 throws DictionaryException {
42
43 try {
44 this.file = new RandomReadingFile(filename);
45// } catch (IOException e) {
46 } catch (Exception e) {
47 throw new DictionaryException(e.toString());
48 }
49
50 try {
51 /*
52 * Check magic number
53 */
54 if (file.readInt() != MAGIC_NUMBER) {
55 throw new DictionaryException();
56 }
57
58 /*
59 * Read header
60 */
61 title = file.readUTF();
62 language = file.readUTF();
63 indexPosition = file.readInt();
64 } catch (Exception e) {
65 throw new DictionaryException("Dictionary is corrupted");
66 }
67 }
68
69 /**
70 * Loads the index

Callers

nothing calls this directly

Calls 3

toStringMethod · 0.80
readIntMethod · 0.80
readUTFMethod · 0.80

Tested by

no test coverage detected