Package com.google.protobuf
Class GeneratedMessageLite.SerializedForm
- java.lang.Object
-
- com.google.protobuf.GeneratedMessageLite.SerializedForm
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- GeneratedMessageLite<MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>>
protected static final class GeneratedMessageLite.SerializedForm extends java.lang.Object implements java.io.SerializableA serialized (serializable) form of the generated message. Stores the message as a class name and a byte array.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]asBytesprivate java.lang.Class<?>messageClassprivate java.lang.StringmessageClassNameprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description SerializedForm(MessageLite regularForm)Creates the serialized form by callingMessageLite.toByteArray().
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GeneratedMessageLite.SerializedFormof(MessageLite message)protected java.lang.ObjectreadResolve()When read from an ObjectInputStream, this method converts this object back to the regular form.private java.lang.Class<?>resolveMessageClass()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
messageClass
private final java.lang.Class<?> messageClass
-
messageClassName
private final java.lang.String messageClassName
-
asBytes
private final byte[] asBytes
-
-
Constructor Detail
-
SerializedForm
SerializedForm(MessageLite regularForm)
Creates the serialized form by callingMessageLite.toByteArray().- Parameters:
regularForm- the message to serialize
-
-
Method Detail
-
of
public static GeneratedMessageLite.SerializedForm of(MessageLite message)
-
readResolve
protected java.lang.Object readResolve() throws java.io.ObjectStreamExceptionWhen read from an ObjectInputStream, this method converts this object back to the regular form. Part of Java's serialization magic.- Returns:
- a GeneratedMessage of the type that was serialized
- Throws:
java.io.ObjectStreamException
-
resolveMessageClass
private java.lang.Class<?> resolveMessageClass() throws java.lang.ClassNotFoundException- Throws:
java.lang.ClassNotFoundException
-
-