mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-19 22:18:26 +00:00
Merge branch 'dev' of https://github.com/loki-project/session-android into refactor-sending-error-handling
This commit is contained in:
commit
26b60c0397
@ -83,14 +83,14 @@ class MessageSendJob(val message: Message, val destination: Destination) : Job {
|
||||
//serialize Message and Destination properties
|
||||
val kryo = Kryo()
|
||||
kryo.isRegistrationRequired = false
|
||||
val serializedMessage = ByteArray(4096)
|
||||
val serializedDestination = ByteArray(4096)
|
||||
var output = Output(serializedMessage)
|
||||
val output = Output(ByteArray(4096), -1) // maxBufferSize '-1' will dynamically grow internally if we run out of room serializing the message
|
||||
kryo.writeClassAndObject(output, message)
|
||||
output.close()
|
||||
output = Output(serializedDestination)
|
||||
val serializedMessage = output.toBytes()
|
||||
output.clear()
|
||||
kryo.writeClassAndObject(output, destination)
|
||||
output.close()
|
||||
val serializedDestination = output.toBytes()
|
||||
return Data.Builder().putByteArray(KEY_MESSAGE, serializedMessage)
|
||||
.putByteArray(KEY_DESTINATION, serializedDestination)
|
||||
.build();
|
||||
|
Loading…
x
Reference in New Issue
Block a user