Partager via


ProtoOutputStream.Write Method

Definition

Overloads

Write(Int64, Boolean)

Write a boolean value for the given fieldId.

Write(Int64, Byte[])

Write a byte[] value for the given fieldId.

Write(Int64, Double)

Write a value for the given fieldId.

Write(Int64, Int32)

Write a value for the given fieldId.

Write(Int64, Int64)

Write a value for the given fieldId.

Write(Int64, Single)

Write a value for the given fieldId.

Write(Int64, String)

Write a string value for the given fieldId.

Write(Int64, Boolean)

Write a boolean value for the given fieldId.

[Android.Runtime.Register("write", "(JZ)V", "", ApiSince=30)]
public void Write (long fieldId, bool val);
[<Android.Runtime.Register("write", "(JZ)V", "", ApiSince=30)>]
member this.Write : int64 * bool -> unit

Parameters

fieldId
Int64

The field identifier constant from the generated class.

val
Boolean

The value.

Attributes

Remarks

Write a boolean value for the given fieldId.

If the field is not a bool field, an IllegalStateException will be thrown.

Java documentation for android.util.proto.ProtoOutputStream.write(long, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Write(Int64, Byte[])

Write a byte[] value for the given fieldId.

[Android.Runtime.Register("write", "(J[B)V", "", ApiSince=30)]
public void Write (long fieldId, byte[]? val);
[<Android.Runtime.Register("write", "(J[B)V", "", ApiSince=30)>]
member this.Write : int64 * byte[] -> unit

Parameters

fieldId
Int64

The field identifier constant from the generated class.

val
Byte[]

The value.

Attributes

Remarks

Write a byte[] value for the given fieldId.

If the field is not a bytes or object field, an exception will be thrown.

Java documentation for android.util.proto.ProtoOutputStream.write(long, byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Write(Int64, Double)

Write a value for the given fieldId.

[Android.Runtime.Register("write", "(JD)V", "", ApiSince=30)]
public void Write (long fieldId, double val);
[<Android.Runtime.Register("write", "(JD)V", "", ApiSince=30)>]
member this.Write : int64 * double -> unit

Parameters

fieldId
Int64

The field identifier constant from the generated class.

val
Double

The value.

Attributes

Remarks

Write a value for the given fieldId.

Will automatically convert for the following field types, and throw an exception for others: double, float, int32, int64, uint32, uint64, sint32, sint64, fixed32, fixed64, sfixed32, sfixed64, bool, enum.

Java documentation for android.util.proto.ProtoOutputStream.write(long, double).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Write(Int64, Int32)

Write a value for the given fieldId.

[Android.Runtime.Register("write", "(JI)V", "", ApiSince=30)]
public void Write (long fieldId, int val);
[<Android.Runtime.Register("write", "(JI)V", "", ApiSince=30)>]
member this.Write : int64 * int -> unit

Parameters

fieldId
Int64

The field identifier constant from the generated class.

val
Int32

The value.

Attributes

Remarks

Write a value for the given fieldId.

Will automatically convert for the following field types, and throw an exception for others: double, float, int32, int64, uint32, uint64, sint32, sint64, fixed32, fixed64, sfixed32, sfixed64, bool, enum.

Java documentation for android.util.proto.ProtoOutputStream.write(long, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Write(Int64, Int64)

Write a value for the given fieldId.

[Android.Runtime.Register("write", "(JJ)V", "", ApiSince=30)]
public void Write (long fieldId, long val);
[<Android.Runtime.Register("write", "(JJ)V", "", ApiSince=30)>]
member this.Write : int64 * int64 -> unit

Parameters

fieldId
Int64

The field identifier constant from the generated class.

val
Int64

The value.

Attributes

Remarks

Write a value for the given fieldId.

Will automatically convert for the following field types, and throw an exception for others: double, float, int32, int64, uint32, uint64, sint32, sint64, fixed32, fixed64, sfixed32, sfixed64, bool, enum.

Java documentation for android.util.proto.ProtoOutputStream.write(long, long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Write(Int64, Single)

Write a value for the given fieldId.

[Android.Runtime.Register("write", "(JF)V", "", ApiSince=30)]
public void Write (long fieldId, float val);
[<Android.Runtime.Register("write", "(JF)V", "", ApiSince=30)>]
member this.Write : int64 * single -> unit

Parameters

fieldId
Int64

The field identifier constant from the generated class.

val
Single

The value.

Attributes

Remarks

Write a value for the given fieldId.

Will automatically convert for the following field types, and throw an exception for others: double, float, int32, int64, uint32, uint64, sint32, sint64, fixed32, fixed64, sfixed32, sfixed64, bool, enum.

Java documentation for android.util.proto.ProtoOutputStream.write(long, float).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Write(Int64, String)

Write a string value for the given fieldId.

[Android.Runtime.Register("write", "(JLjava/lang/String;)V", "", ApiSince=30)]
public void Write (long fieldId, string? val);
[<Android.Runtime.Register("write", "(JLjava/lang/String;)V", "", ApiSince=30)>]
member this.Write : int64 * string -> unit

Parameters

fieldId
Int64

The field identifier constant from the generated class.

val
String

The value.

Attributes

Remarks

Write a string value for the given fieldId.

If the field is not a string field, an exception will be thrown.

Java documentation for android.util.proto.ProtoOutputStream.write(long, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to