to top
Android APIs
public static class

DropBoxManager.Entry

extends Object
implements Parcelable Closeable
java.lang.Object
   ↳ android.os.DropBoxManager.Entry

Class Overview

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

[Expand]
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's marshalled 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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable
From interface java.io.Closeable
From interface java.lang.AutoCloseable

Fields

public static final Creator<DropBoxManager.Entry> CREATOR

Added in API level 8

Public Constructors

public DropBoxManager.Entry (String tag, long millis)

Added in API level 8

Create a new empty Entry with no contents.

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

Added in API level 8

Create a new Entry with plain text contents.

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

Added in API level 8

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

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

Added in API level 8

Create a new Entry with streaming data contents. Takes ownership of the ParcelFileDescriptor.

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

Added in API level 8

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

Throws
IOException

Public Methods

public void close ()

Added in API level 8

Close the input stream associated with this entry.

public int describeContents ()

Added in API level 8

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

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public int getFlags ()

Added in API level 8

Returns

public InputStream getInputStream ()

Added in API level 8

Returns
  • the uncompressed contents of the entry, or null if the contents were lost
Throws
IOException

public String getTag ()

Added in API level 8

Returns
  • the tag originally attached to the entry.

public String getText (int maxBytes)

Added in API level 8

Parameters
maxBytes of string to return (will truncate at this length).
Returns
  • the uncompressed text contents of the entry, null if the entry is not text.

public long getTimeMillis ()

Added in API level 8

Returns
  • time when the entry was originally created.

public void writeToParcel (Parcel out, int flags)

Added in API level 8

Flatten this object in to a Parcel.

Parameters
out The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.