WireBuffer

class WireBuffer(initialBytes: ByteArray? = null, offset: Int = 0, initialLength: Int = initialBytes?.let { it.size - offset } ?: 0)

A buffer that can be used for both reading and writing the protobuf wire format. Writes always append to the end of the buffer, while reads always consume from the current read position, which initially is at the beginning of the buffer.

Constructors

Link copied to clipboard
constructor(initialBytes: ByteArray? = null, offset: Int = 0, initialLength: Int = initialBytes?.let { it.size - offset } ?: 0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var length: Int
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the raw varint: does not perform zigzag decoding.

Link copied to clipboard

Returns the raw varint: does not perform zigzag decoding.

Link copied to clipboard
fun write(value: ByteArray)
Link copied to clipboard
Link copied to clipboard
fun writeByte(value: Byte)
Link copied to clipboard
fun writeFixed32(value: Int)
Link copied to clipboard
fun writeFixed64(value: Long)
Link copied to clipboard
fun writeVarInt(value: Int, extraBytes: Int = 0)
fun writeVarInt(value: Long, extraBytes: Int = 0)