Udostępnij za pośrednictwem


BackupDataOutput.WriteEntityHeader(String, Int32) Method

Definition

Mark the beginning of one record in the backup data stream.

[Android.Runtime.Register("writeEntityHeader", "(Ljava/lang/String;I)I", "GetWriteEntityHeader_Ljava_lang_String_IHandler")]
public virtual int WriteEntityHeader (string? key, int dataSize);
[<Android.Runtime.Register("writeEntityHeader", "(Ljava/lang/String;I)I", "GetWriteEntityHeader_Ljava_lang_String_IHandler")>]
abstract member WriteEntityHeader : string * int -> int
override this.WriteEntityHeader : string * int -> int

Parameters

key
String

A string key that uniquely identifies the data record within the application. Keys whose first character is \uFF00 or higher are not valid.

dataSize
Int32

The size in bytes of this record's data. Passing a dataSize of -1 indicates that the record under this key should be deleted.

Returns

The number of bytes written to the backup stream

Attributes

Exceptions

if the write failed

Remarks

Mark the beginning of one record in the backup data stream. This must be called before #writeEntityData.

Java documentation for android.app.backup.BackupDataOutput.writeEntityHeader(java.lang.String, 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