+
+ @Override
+ void writeModule(final QNameModule module) throws IOException {
+ final Integer value = moduleCodeMap.get(module);
+ if (value == null) {
+ // Fresh QNameModule, remember it and emit as three strings
+ moduleCodeMap.put(module, moduleCodeMap.size());
+ writeByte(TokenTypes.IS_MODULE_VALUE);
+ super.writeModule(module);
+ } else {
+ // We have already seen this QNameModule: write its code
+ writeByte(TokenTypes.IS_MODULE_CODE);
+ writeInt(value);
+ }
+ }