mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
working ByteArray64Reader (UTF-8 compliant with proper surrogate pairing)
This commit is contained in:
@@ -19,9 +19,12 @@ object WriteActor {
|
||||
}
|
||||
|
||||
fun encodeToByteArray64(actor: Actor): ByteArray64 {
|
||||
val ba = ByteArray64()
|
||||
this.invoke(actor).toByteArray().forEach { ba.add(it) }
|
||||
return ba
|
||||
val baw = ByteArray64Writer(Common.CHARSET)
|
||||
|
||||
Common.jsoner.toJson(actor, actor.javaClass, baw)
|
||||
baw.flush(); baw.close()
|
||||
|
||||
return baw.toByteArray64()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user