Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.util.Locale support #64

Open
MacX19 opened this issue Jul 13, 2022 · 2 comments
Open

java.util.Locale support #64

MacX19 opened this issue Jul 13, 2022 · 2 comments

Comments

@MacX19
Copy link
Contributor

MacX19 commented Jul 13, 2022

Do you plan to support java.util.Locale serialization? Or should I use my own Serializer<Locale>?

@incubos
Copy link
Member

incubos commented Jan 17, 2023

We do not have any specific plans w.r.t. java.util.Locale. Serializable classes are naturally supported. Could you please clarify the problem you are trying to solve?

@MacX19
Copy link
Contributor Author

MacX19 commented Jan 17, 2023

Oh, I don't remember exactly why. I have already written my own Serializer. I tried now a simple example and got an error:

    byte[] res;
    try (PersistStream stream = new PersistStream()) {
      Locale locale = new Locale("en", "US");
      stream.writeObject(locale);
      res = stream.toByteArray();
    }
    try (DeserializeStream des = new DeserializeStream(res)) {
      System.out.println(des.readObject());
    }
Exception in thread "main" java.io.IOException: writeObject() is not fully supported. See implementation notes.
	at one.nio.serial.gen.NullObjectOutputStream.unsupported(NullObjectOutputStream.java:159)
	at one.nio.serial.gen.NullObjectOutputStream.putFields(NullObjectOutputStream.java:50)
	at java.util.Locale.writeObject(Locale.java:2156)
	at sun.reflect.Delegate0_Locale.write(Unknown Source)
	at one.nio.serial.GeneratedSerializer.write(GeneratedSerializer.java:121)
	at one.nio.serial.PersistStream.writeObject(PersistStream.java:60)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants