Most visited

Recently visited

Added in API level 8

DropBoxManager.Entry

public static class DropBoxManager.Entry
extends Object implements Parcelable, Closeable

java.lang.Object
    android.os.DropBoxManager.Entry


从下拉框中检索单个条目。 这可能包括对流的引用,因此在完成使用时必须调用close()

摘要(Summary)

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<DropBoxManager.Entry> CREATOR

Public constructors

DropBoxManager.Entry(String tag, long millis)

创建一个没有内容的新空白条目。

DropBoxManager.Entry(String tag, long millis, String text)

用纯文本内容创建一个新条目。

DropBoxManager.Entry(String tag, long millis, byte[] data, int flags)

创建一个带有字节数组内容的新条目。

DropBoxManager.Entry(String tag, long millis, ParcelFileDescriptor data, int flags)

用流式数据内容创建一个新条目。

DropBoxManager.Entry(String tag, long millis, File data, int flags)

从文件中读取内容创建一个新条目。

公共方法(Public methods)

void close()

关闭与此条目相关联的输入流。

int describeContents()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。

int getFlags()
InputStream getInputStream()
String getTag()
String getText(int maxBytes)
long getTimeMillis()
void writeToParcel(Parcel out, int flags)

将此对象平铺到一个包裹中。

继承方法(Inherited methods)

From class java.lang.Object
From interface android.os.Parcelable
From interface java.io.Closeable
From interface java.lang.AutoCloseable

Fields

CREATOR

Added in API level 8
Creator<DropBoxManager.Entry> CREATOR

Public constructors

DropBoxManager.Entry

Added in API level 8
DropBoxManager.Entry (String tag, 
                long millis)

创建一个没有内容的新空白条目。

参数(Parameters)
tag String
millis long

DropBoxManager.Entry

Added in API level 8
DropBoxManager.Entry (String tag, 
                long millis, 
                String text)

用纯文本内容创建一个新条目。

参数(Parameters)
tag String
millis long
text String

DropBoxManager.Entry

Added in API level 8
DropBoxManager.Entry (String tag, 
                long millis, 
                byte[] data, 
                int flags)

创建一个带有字节数组内容的新条目。 创建此条目后,不得修改数据数组。

参数(Parameters)
tag String
millis long
data byte
flags int

DropBoxManager.Entry

Added in API level 8
DropBoxManager.Entry (String tag, 
                long millis, 
                ParcelFileDescriptor data, 
                int flags)

用流式数据内容创建一个新条目。 获取ParcelFileDescriptor的所有权。

参数(Parameters)
tag String
millis long
data ParcelFileDescriptor
flags int

DropBoxManager.Entry

Added in API level 8
DropBoxManager.Entry (String tag, 
                long millis, 
                File data, 
                int flags)

从文件中读取内容创建一个新条目。 该文件将在条目内容被请求时被读取。

参数(Parameters)
tag String
millis long
data File
flags int
抛出异常(Throws)
IOException

公共方法(Public methods)

close

Added in API level 8
void close ()

关闭与此条目相关联的输入流。

describeContents

Added in API level 8
int describeContents ()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。

返回(Returns)
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getFlags

Added in API level 8
int getFlags ()

返回(Returns)
int flags describing the content returned by getInputStream().

getInputStream

Added in API level 8
InputStream getInputStream ()

返回(Returns)
InputStream the uncompressed contents of the entry, or null if the contents were lost
抛出异常(Throws)
IOException

getTag

Added in API level 8
String getTag ()

返回(Returns)
String the tag originally attached to the entry.

getText

Added in API level 8
String getText (int maxBytes)

参数(Parameters)
maxBytes int: of string to return (will truncate at this length).
返回(Returns)
String the uncompressed text contents of the entry, null if the entry is not text.

getTimeMillis

Added in API level 8
long getTimeMillis ()

返回(Returns)
long time when the entry was originally created.

writeToParcel

Added in API level 8
void writeToParcel (Parcel out, 
                int flags)

将此对象平铺到一个包裹中。

参数(Parameters)
out Parcel: The Parcel in which the object should be written.
flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

Hooray!