Skip to content

Most visited

Recently visited

navigation

DropBoxManager.Entry

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

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


A single entry retrieved from the drop box. This may include a reference to a stream, so you must call close() when you are done using it.

Summary

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<DropBoxManager.Entry> CREATOR

Public constructors

DropBoxManager.Entry(String tag, long millis)

Create a new empty Entry with no contents.

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

Create a new Entry with plain text contents.

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

Create a new Entry with byte array contents.

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

Create a new Entry with streaming data contents.

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

Create a new Entry with the contents read from a file.

Public methods

void close()

Close the input stream associated with this entry.

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

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

Flatten this object in to a Parcel.

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)

Create a new empty Entry with no contents.

Parameters
tag String
millis long

DropBoxManager.Entry

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

Create a new Entry with plain text contents.

Parameters
tag String
millis long
text String

DropBoxManager.Entry

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

Create a new Entry with byte array contents. The data array must not be modified after creating this entry.

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)

Create a new Entry with streaming data contents. Takes ownership of the 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)

Create a new Entry with the contents read from a file. The file will be read when the entry's contents are requested.

Parameters
tag String
millis long
data File
flags int
Throws
IOException

Public methods

close

Added in API level 8
void close ()

Close the input stream associated with this entry.

describeContents

Added in API level 8
int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

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)

Flatten this object in to a Parcel.

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.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.