wire-runtime / com.squareup.wire / Message

Message

abstract class Message<M : Message<M, B>, B : Builder<M, B>> : Serializable

A protocol buffer message.

Types

Builder

abstract class Builder<M : Message<M, B>, B : Builder<M, B>>

Superclass for protocol buffer message builders.

Functions

adapter

fun adapter(): ProtoAdapter<M>

The ProtoAdapter for encoding and decoding messages of this type.

encode

fun encode(sink: BufferedSink): Unit
fun encode(stream: OutputStream): Unit

Encode this message and write it to stream.

fun encode(): ByteArray

Encode this message as a byte[].

newBuilder

abstract fun newBuilder(): B

Returns a new builder initialized with the data in this message.

toString

open fun toString(): String

unknownFields

fun unknownFields(): ByteString

Returns a byte string containing the proto encoding of this message's unknown fields. Returns an empty byte string if this message has no unknown fields.

withoutUnknownFields

fun withoutUnknownFields(): M

Returns this message with any unknown fields removed.

Inheritors

AndroidMessage

abstract class AndroidMessage<M : Message<M, B>, B : Builder<M, B>> : Message<M, B>, Parcelable

An Android-specific Message which adds support for Parcelable.