com.johnsnowlabs.nlp.serialization
LegacyObjectInputStream
Companion object LegacyObjectInputStream
class LegacyObjectInputStream extends ObjectInputStream
Custom ObjectInputStream that ignores the serialVersionUID check for a provided class during deserialization.
- Alphabetic
- By Inheritance
- LegacyObjectInputStream
- ObjectInputStream
- ObjectStreamConstants
- ObjectInput
- DataInput
- InputStream
- Closeable
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
LegacyObjectInputStream(in: ByteArrayInputStream, replacedClass: Class[_], serializedClassName: String, resolveCustomDescriptor: (ObjectStreamClass) ⇒ ObjectStreamClass)
- in
ByteArrayInputStream of the deserialization
- replacedClass
The class that should be the replacement
- serializedClassName
The name of the serialized class in the input stream
- resolveCustomDescriptor
Method to provide additional legacy class descriptor mappings for custom classes. By default, doesn't provide additional classes.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
available(): Int
- Definition Classes
- ObjectInputStream → ObjectInput → InputStream
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
close(): Unit
- Definition Classes
- ObjectInputStream → ObjectInput → InputStream → Closeable → AutoCloseable
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
defaultReadObject(): Unit
- Definition Classes
- ObjectInputStream
- Annotations
- @throws( classOf[java.io.IOException] ) @throws( ... )
-
def
enableResolveObject(arg0: Boolean): Boolean
- Attributes
- protected[java.io]
- Definition Classes
- ObjectInputStream
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
mark(arg0: Int): Unit
- Definition Classes
- InputStream
-
def
markSupported(): Boolean
- Definition Classes
- InputStream
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
read(arg0: Array[Byte], arg1: Int, arg2: Int): Int
- Definition Classes
- ObjectInputStream → ObjectInput → InputStream
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
read(): Int
- Definition Classes
- ObjectInputStream → ObjectInput → InputStream
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
read(arg0: Array[Byte]): Int
- Definition Classes
- InputStream
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readBoolean(): Boolean
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readByte(): Byte
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readChar(): Char
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readClassDescriptor(): ObjectStreamClass
Reads the class descriptor from the serialization stream, handling conflicting serialVersionUIDs (SUID) of old Spark NLP objects.
Reads the class descriptor from the serialization stream, handling conflicting serialVersionUIDs (SUID) of old Spark NLP objects.
We try to read the objects regardless of SUID (by ignoring them). In the case of reading old Maps, we need to use the serialization proxy from Scala 2.12 (removed in 2.13).
Taken and adapted from https://stackoverflow.com/questions/795470/how-to-deserialize-an-object-persisted-in-a-db-now-when-the-object-has-different
- returns
The class descriptor to be used for deserialization.
- Attributes
- protected
- Definition Classes
- LegacyObjectInputStream → ObjectInputStream
- Annotations
- @throws( "I/O error occurred" ) @throws( ... )
- Exceptions thrown
ClassNotFoundExceptionif the class of a serialized object could not be foundIOExceptionif an I/O error occurs
-
def
readDouble(): Double
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readFields(): GetField
- Definition Classes
- ObjectInputStream
- Annotations
- @throws( classOf[java.io.IOException] ) @throws( ... )
-
def
readFloat(): Float
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readFully(arg0: Array[Byte], arg1: Int, arg2: Int): Unit
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readFully(arg0: Array[Byte]): Unit
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readInt(): Int
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readLong(): Long
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
final
def
readObject(): AnyRef
- Definition Classes
- ObjectInputStream → ObjectInput
- Annotations
- @throws( classOf[java.io.IOException] ) @throws( ... )
-
def
readObjectOverride(): AnyRef
- Attributes
- protected[java.io]
- Definition Classes
- ObjectInputStream
- Annotations
- @throws( classOf[java.io.IOException] ) @throws( ... )
-
def
readShort(): Short
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readStreamHeader(): Unit
- Attributes
- protected[java.io]
- Definition Classes
- ObjectInputStream
- Annotations
- @throws( classOf[java.io.IOException] ) @throws( ... )
-
def
readUTF(): String
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readUnshared(): AnyRef
- Definition Classes
- ObjectInputStream
- Annotations
- @throws( classOf[java.io.IOException] ) @throws( ... )
-
def
readUnsignedByte(): Int
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
readUnsignedShort(): Int
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
registerValidation(arg0: ObjectInputValidation, arg1: Int): Unit
- Definition Classes
- ObjectInputStream
- Annotations
- @throws( classOf[java.io.NotActiveException] ) @throws( ... )
- val replacedClass: Class[_]
-
def
reset(): Unit
- Definition Classes
- InputStream
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
resolveClass(desc: ObjectStreamClass): Class[_]
Resolves a class after readClassDescriptor during deserialization, trying first with the thread context classloader (Spark separates loaders), then falling back to default behavior.
Resolves a class after readClassDescriptor during deserialization, trying first with the thread context classloader (Spark separates loaders), then falling back to default behavior.
- desc
The class descriptor read from the deserialization stream
- returns
The resolved class
- Attributes
- protected
- Definition Classes
- LegacyObjectInputStream → ObjectInputStream
- Annotations
- @throws( ... ) @throws( ... )
-
def
resolveObject(arg0: Any): AnyRef
- Attributes
- protected[java.io]
- Definition Classes
- ObjectInputStream
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
resolveProxyClass(arg0: Array[String]): Class[_]
- Attributes
- protected[java.io]
- Definition Classes
- ObjectInputStream
- Annotations
- @throws( classOf[java.io.IOException] ) @throws( ... )
- val serializedClassName: String
-
def
skip(arg0: Long): Long
- Definition Classes
- InputStream
- Annotations
- @throws( classOf[java.io.IOException] )
-
def
skipBytes(arg0: Int): Int
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] )
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
Deprecated Value Members
-
def
readLine(): String
- Definition Classes
- ObjectInputStream → DataInput
- Annotations
- @throws( classOf[java.io.IOException] ) @Deprecated
- Deprecated