DataOutput (DataOutput out, StringEnumerator enumerator) { return new GraphDataOutput(out) { @Override public void writeUTF(@NotNull String s) throws IOException { writeInt(enumerator.toNumber(s)); } }; }