Added in API level 8

Entry


open class Entry : Parcelable, Closeable
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, text: String)

Create a new Entry with plain text contents.

Entry(tag: String, millis: Long, data: ByteArray?, flags: Int)

Create a new Entry with byte array contents.

Entry(tag: String, millis: Long, data: ParcelFileDescriptor?, flags: Int)

Create a new Entry with streaming data contents.

Entry(tag: String, millis: Long, data: File, flags: Int)

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

Public methods
open Unit

Close the input stream associated with this entry.

open Int

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)

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,
    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.

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 android.os.DropBoxManager#IS_EMPTY, android.os.DropBoxManager#IS_TEXT, and android.os.DropBoxManager#IS_GZIPPED

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 android.os.DropBoxManager#IS_EMPTY, android.os.DropBoxManager#IS_TEXT, and android.os.DropBoxManager#IS_GZIPPED

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 android.os.DropBoxManager#IS_EMPTY, android.os.DropBoxManager#IS_TEXT, and android.os.DropBoxManager#IS_GZIPPED

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
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

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 android.os.DropBoxManager#IS_EMPTY, android.os.DropBoxManager#IS_TEXT, and android.os.DropBoxManager#IS_GZIPPED

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
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 android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

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