mirror of
https://github.com/corda/corda.git
synced 2025-03-22 03:55:26 +00:00
Merge pull request #1029 from corda/kat-makePutObjectExtensible
Make serialise putObject function an open function
This commit is contained in:
commit
5438e82e68
@ -34,7 +34,7 @@ open class SerializationOutput(internal val serializerFactory: SerializerFactory
|
||||
// Our object
|
||||
writeObject(obj, this)
|
||||
// The schema
|
||||
putObject(Schema(schemaHistory.toList()))
|
||||
writeSchema(Schema(schemaHistory.toList()), this)
|
||||
}
|
||||
}
|
||||
val bytes = ByteArray(data.encodedSize().toInt() + 8)
|
||||
@ -53,6 +53,10 @@ open class SerializationOutput(internal val serializerFactory: SerializerFactory
|
||||
writeObject(obj, data, obj.javaClass)
|
||||
}
|
||||
|
||||
open fun writeSchema(schema: Schema, data: Data) {
|
||||
data.putObject(schema)
|
||||
}
|
||||
|
||||
internal fun writeObjectOrNull(obj: Any?, data: Data, type: Type) {
|
||||
if (obj == null) {
|
||||
data.putNull()
|
||||
|
Loading…
x
Reference in New Issue
Block a user