TermDictionary implements Serializable { public String toFile(String filename, boolean compress) throws IOException { Stopwatch stopwatch = Stopwatch.createStarted(); Utils.objectToFile(filename, this, compress, false); log.debug("TIMER# serialized dictionary to file: " + filename + ", in: " + stopwatch); return filename; }  abstract Integer get(String key); abstract String get(Integer value); abstract int size(); abstract void put(String key, Integer value); abstract boolean containsKey(String key); long encodeBlankNode(String blankNode); long encode(String term); String decode(long value); void add(String part); static TermDictionary populateRDFOWLData(TermDictionary dictionary); String toFile(String filename, boolean compress); static TermDictionary fromFile(String file, boolean compressed); String toJson(); static TermDictionary fromJsonFile(String jsonFile); static TermDictionary fromJsonFile(String jsonFile, boolean compressed); String toJsonFile(String filename, boolean compress); static TermDictionary fromJsonString(String json); int getLargestResourceId(); @Override String toString(); static final Gson GSON; static final int RESOURCE_ID_INVALID; static final String INVALID_RESOURCE; static final int RESOURCE_ID_START; }
@Test public void testSerialize() throws IOException { this.dictionary.toFile(FilenameUtils.getLocalFilePath("dictionary.kryo.gz"), true); }