标签: scala protocol-buffers scala-java-interop
我有一个返回ByteString对象的函数:
private def getEvent(value: DataOutputValue): com.google.protobuf.ByteString = { value.getRecordedEvent.getEvent.getEvent }
如何从Scala中获取这些字节?
答案 0 :(得分:3)
致电toByteArray:
toByteArray
val bytes = getEvent(someDateOutput).toByteArray