private Object writeReplace() throws NotSerializableException {
      throw new NotSerializableException("serialization is not supported");
    }
This is a modified copy of Gson's internal LazilyParsedNumber.
java_src/src/main/java/com/google/crypto/tink/internal/JsonParser.java