Added in API level 1

InvalidClassException

open class InvalidClassException : ObjectStreamException
kotlin.Any
   ↳ kotlin.Throwable
   ↳ java.lang.Exception
   ↳ java.io.IOException
   ↳ java.io.ObjectStreamException
   ↳ java.io.InvalidClassException

Thrown when the Serialization runtime detects one of the following problems with a Class.

  • The serial version of the class does not match that of the class descriptor read from the stream
  • The class contains unknown datatypes
  • The class does not have an accessible no-arg constructor
  • The ObjectStreamClass of an enum constant does not represent an enum type
  • Other conditions given in the Java Object Serialization Specification

Summary

Public constructors

Report an InvalidClassException for the reason specified.

InvalidClassException(cname: String!, reason: String!)

Constructs an InvalidClassException object.

Properties
String!

Name of the invalid class.

open String?

Produce the message and include the classname, if present.

Public constructors

InvalidClassException

Added in API level 1
InvalidClassException(reason: String!)

Report an InvalidClassException for the reason specified.

Parameters
reason String!: String describing the reason for the exception.

InvalidClassException

Added in API level 1
InvalidClassException(
    cname: String!,
    reason: String!)

Constructs an InvalidClassException object.

Parameters
cname String!: a String naming the invalid class.
reason String!: a String describing the reason for the exception.

Properties

classname

Added in API level 1
var classname: String!

Name of the invalid class.

message

Added in API level 1
open val message: String?

Produce the message and include the classname, if present.

Return
String? the detail message string of this Throwable instance (which may be null).