wire-runtime / com.squareup.wire / AndroidMessage

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.

Functions

describeContents

fun describeContents(): Int

newCreator

open static fun <E : Any> newCreator(adapter: ProtoAdapter<E>): Creator<E>

Creates a new Parcelable.Creator using adapter for serialization.

writeToParcel

fun writeToParcel(dest: Parcel, flags: Int): Unit

Inherited 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.