-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
[0.5.27 regression] serializedSize does not work with java serialization #121
Comments
Reproducible as: def checkJavaSerialization[T <: GeneratedMessage](a: T) = {
val baos = new ByteArrayOutputStream()
val oos = new ObjectOutputStream(baos)
oos.writeObject(a)
oos.close()
val ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray))
val b = ois.readObject().asInstanceOf[T]
val abytes = a.toByteArray
val bbytes = b.toByteArray //crashes here
abytes mustBe bbytes
} Stacktrace like:
|
thesamet
added a commit
that referenced
this issue
Jun 1, 2016
fixes #121: java serialization breaks serializedSize
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do not use 0.5.27, 0.5.28 if you serialize case classes with java serialization and then serialize them as protobufs.
I am working on the fix.
The text was updated successfully, but these errors were encountered: