mirror of
https://github.com/corda/corda.git
synced 2025-03-22 20:15:19 +00:00
Make serialise putObject function an open function
For testing I need to be able to mess with the schema before it gets added to the envelope, extract the function where that happens and make it open so the tests can do what they want
This commit is contained in:
parent
78ecff7933
commit
534f60dc57
@ -34,7 +34,7 @@ open class SerializationOutput(internal val serializerFactory: SerializerFactory
|
|||||||
// Our object
|
// Our object
|
||||||
writeObject(obj, this)
|
writeObject(obj, this)
|
||||||
// The schema
|
// The schema
|
||||||
putObject(Schema(schemaHistory.toList()))
|
putObject(Schema(schemaHistory.toList()), this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val bytes = ByteArray(data.encodedSize().toInt() + 8)
|
val bytes = ByteArray(data.encodedSize().toInt() + 8)
|
||||||
@ -53,6 +53,10 @@ open class SerializationOutput(internal val serializerFactory: SerializerFactory
|
|||||||
writeObject(obj, data, obj.javaClass)
|
writeObject(obj, data, obj.javaClass)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open fun putObject(schema: Schema, data: Data) {
|
||||||
|
data.putObject(schema)
|
||||||
|
}
|
||||||
|
|
||||||
internal fun writeObjectOrNull(obj: Any?, data: Data, type: Type) {
|
internal fun writeObjectOrNull(obj: Any?, data: Data, type: Type) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
data.putNull()
|
data.putNull()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user