DropBoxManager.Entry | API reference | Android Developers (original) (raw)
open class Entry : 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 class Parcelable Int CONTENTS_FILE_DESCRIPTOR Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor. Int PARCELABLE_WRITE_RETURN_VALUE Flag for use with writeToParcel: the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)". Some implementations may want to release resources at this point. |
Public constructors |
---|
Entry(tag: String, millis: Long) Create a new empty Entry with no contents. |
Entry(tag: String, millis: Long, data: ParcelFileDescriptor?, flags: Int) Create a new Entry with streaming data contents. |
Entry(tag: String, millis: Long, data: ByteArray?, flags: Int) Create a new Entry with byte array contents. |
Entry(tag: String, millis: Long, data: File, flags: Int) Create a new Entry with the contents read from a file. |
Entry(tag: String, millis: Long, text: String) Create a new Entry with plain text contents. |
Public methods | |
---|---|
open Unit | close() Close the input stream associated with this entry. |
open Int | describeContents() |
open Int | getFlags() |
open InputStream? | getInputStream() |
open String | getTag() |
open String? | getText(maxBytes: Int) |
open Long | getTimeMillis() Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
open Unit | writeToParcel(out: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<DropBoxManager.Entry!> | CREATOR |
Public constructors
Entry
Entry(
tag: String,
millis: Long)
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
Entry(
tag: String,
millis: Long,
text: String)
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
open fun close(): Unit
Close the input stream associated with this entry.
Exceptions | |
---|---|
java.lang.Exception | if this resource cannot be closed |
java.io.IOException | if an I/O error occurs |
getInputStream
open fun getInputStream(): InputStream?
Return | |
---|---|
InputStream? | the uncompressed contents of the entry, or null if the contents were lost |
getTag
open fun getTag(): String
Return | |
---|---|
String | the tag originally attached to the entry. This value cannot be null. |
getText
open fun getText(maxBytes: Int): String?
Parameters | |
---|---|
maxBytes | Int: of string to return (will truncate at this length). Value is a non-negative number of bytes. |
Return | |
---|---|
String? | the uncompressed text contents of the entry, null if the entry is not text. |
getTimeMillis
open fun getTimeMillis(): Long
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
Return | |
---|---|
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. |