DropBoxManager.Entry | API reference | Android Developers
public
static
class
DropBoxManager.Entry
extends Object
implements
Closeable,
Parcelable
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
|
Fields | |
|---|---|
public
static
final
Creator<DropBoxManager.Entry> |
CREATOR
|
Public constructors | |
|---|---|
Entry(String tag, long millis)
Create a new empty Entry with no contents. |
|
Entry(String tag, long millis, ParcelFileDescriptor data, int flags)
Create a new Entry with streaming data contents. |
|
Entry(String tag, long millis, byte[] data, int flags)
Create a new Entry with byte array contents. |
|
Entry(String tag, long millis, File data, int flags)
Create a new Entry with the contents read from a file. |
|
Entry(String tag, long millis, String text)
Create a new Entry with plain text contents. |
|
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()
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
void
|
writeToParcel(Parcel out, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
From class
| |||||||||||||||||||||||
|
From interface
| |||||||||||||||||||||||
|
From interface
| |||||||||||||||||||||||
|
From interface
| |||||||||||||||||||||||
Fields
Public constructors
Entry
public Entry (String tag, long millis)
Create a new empty Entry with no contents.
| Parameters | |
|---|---|
tag |
String: This value cannot be null. |
millis |
long: Value is a non-negative timestamp measured as the number of
milliseconds since 1970-01-01T00:00:00Z. |
Entry
public 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: This value cannot be null. |
millis |
long: Value is a non-negative timestamp measured as the number of
milliseconds since 1970-01-01T00:00:00Z. |
data |
ParcelFileDescriptor: This value may be null. |
flags |
int: Value is either 0 or a combination of the following:
|
Entry
public 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: This value cannot be null. |
millis |
long: Value is a non-negative timestamp measured as the number of
milliseconds since 1970-01-01T00:00:00Z. |
data |
byte: This value may be null. |
flags |
int: Value is either 0 or a combination of the following:
|
Entry
public 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: This value cannot be null. |
millis |
long: Value is a non-negative timestamp measured as the number of
milliseconds since 1970-01-01T00:00:00Z. |
data |
File: This value cannot be null. |
flags |
int: Value is either 0 or a combination of the following:
|
| Throws | |
|---|---|
IOException |
|
Entry
public Entry (String tag, long millis, String text)
Create a new Entry with plain text contents.
| Parameters | |
|---|---|
tag |
String: This value cannot be null. |
millis |
long: Value is a non-negative timestamp measured as the number of
milliseconds since 1970-01-01T00:00:00Z. |
text |
String: This value cannot be null. |
Public methods
close
public void close ()
Close the input stream associated with this entry.
describeContents
public 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.
Value is either 0 or
|
getTag
public String getTag ()
| Returns | |
|---|---|
String |
the tag originally attached to the entry.
This value cannot be null. |
getText
public String getText (int maxBytes)
| Parameters | |
|---|---|
maxBytes |
int: of string to return (will truncate at this length).
Value is a non-negative number of bytes. |
| Returns | |
|---|---|
String |
the uncompressed text contents of the entry, null if the entry is not text. |
getTimeMillis
public long getTimeMillis ()
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
| Returns | |
|---|---|
long |
time when the entry was originally created.
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |