diff --git a/proto/runtime/src/main/kotlin/CodedInputStream.kt b/proto/runtime/src/main/kotlin/CodedInputStream.kt index be1dde7f777..5474b90fcc4 100644 --- a/proto/runtime/src/main/kotlin/CodedInputStream.kt +++ b/proto/runtime/src/main/kotlin/CodedInputStream.kt @@ -86,9 +86,12 @@ class CodedInputStream(val buffer: ByteArray) { fun readSInt64(expectedFieldNumber: Int): Long { val tag = readTag(expectedFieldNumber, WireType.VARINT) - return readZigZag64NoTag() + return readSInt64NoTag() } + fun readSInt64NoTag(): Long { + return readZigZag64NoTag() + } fun readBytes(expectedFieldNumber: Int): ByteArray { val tag = readTag(expectedFieldNumber, WireType.LENGTH_DELIMITED) return readBytesNoTag() diff --git a/proto/runtime/src/main/kotlin/CodedOutputStream.kt b/proto/runtime/src/main/kotlin/CodedOutputStream.kt index 767f648d8fc..a55d5a9f2c7 100644 --- a/proto/runtime/src/main/kotlin/CodedOutputStream.kt +++ b/proto/runtime/src/main/kotlin/CodedOutputStream.kt @@ -26,6 +26,10 @@ class CodedOutputStream(val buffer: ByteArray) { writeInt32(fieldNumber, value) } + fun writeUInt32NoTag(value: Int) { + writeInt32NoTag(value) + } + fun writeInt64(fieldNumber: Int, value: Long) { writeTag(fieldNumber, WireType.VARINT) writeInt64NoTag(value) @@ -36,6 +40,10 @@ class CodedOutputStream(val buffer: ByteArray) { writeInt64(fieldNumber, value) } + fun writeUInt64NoTag(value: Long) { + writeInt64NoTag(value) + } + fun writeBool(fieldNumber: Int, value: Boolean) { writeTag(fieldNumber, WireType.VARINT) writeBoolNoTag(value)