Added in API level 8

Entry


open class Entry : Closeable, Parcelable
kotlin.Any
   ↳ 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
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 the input stream associated with this entry.

open Int

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

open Int

open InputStream?

open String

open String?
getText(maxBytes: Int)

open Long

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)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<DropBoxManager.Entry!>

Public constructors

Entry

Added in API level 8
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

Added in API level 8
Entry(
    tag: String,
    millis: Long,
    data: ParcelFileDescriptor?,
    flags: Int)

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

Added in API level 8
Entry(
    tag: String,
    millis: Long,
    data: ByteArray?,
    flags: Int)

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 ByteArray?: This value may be null.
flags Int: Value is either 0 or a combination of the following:

Entry

Added in API level 8
Entry(
    tag: String,
    millis: Long,
    data: File,
    flags: Int)

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:

Entry

Added in API level 8
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

Added in API level 8
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

describeContents

Added in API level 8
open fun describeContents(): Int

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(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getFlags

Added in API level 8
open fun getFlags(): Int
Return
Int flags describing the content returned by getInputStream().
Value is either 0 or a combination of the following:

getInputStream

Added in API level 8
open fun getInputStream(): InputStream?
Return
InputStream? the uncompressed contents of the entry, or null if the contents were lost

getTag

Added in API level 8
open fun getTag(): String
Return
String the tag originally attached to the entry.
This value cannot be null.

getText

Added in API level 8
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

Added in API level 8
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.

writeToParcel

Added in API level 8
open fun writeToParcel(
    out: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

Added in API level 8
static val CREATOR: Parcelable.Creator<DropBoxManager.Entry!>