code: void writeObject(java.io.ObjectOutputStream out) throws IOException {
          // when using object serialization, write the json bytes
          byte[] bytes = toString().getBytes(StandardCharsets.UTF_8);
          out.writeInt(bytes.length);
          out.write(bytes);
      }
docs: used by java serialization