Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Entry

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/os/DropBoxManager.Entry "View this page in Java")

```
open class Entry : Closeable, Parcelable
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.os.DropBoxManager.Entry](https://developer.android.com/reference/kotlin/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 ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/os/Parcelable` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` Descriptor bit used with `https://developer.android.com/reference/kotlin/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` Flag for use with `https://developer.android.com/reference/kotlin/android/os/Parcelable#writeToParcel(android.os.Parcel,%20kotlin.Int)`: 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. <br /> | ||

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#Entry(kotlin.String,%20kotlin.Long)(tag: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, millis: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Create a new empty Entry with no contents. |
| `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#Entry(kotlin.String,%20kotlin.Long,%20android.os.ParcelFileDescriptor,%20kotlin.Int)(tag: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, millis: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html, data: https://developer.android.com/reference/kotlin/android/os/ParcelFileDescriptor?, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Create a new Entry with streaming data contents. |
| `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#Entry(kotlin.String,%20kotlin.Long,%20kotlin.ByteArray,%20kotlin.Int)(tag: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, millis: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html, data: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html?, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Create a new Entry with byte array contents. |
| `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#Entry(kotlin.String,%20kotlin.Long,%20java.io.File,%20kotlin.Int)(tag: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, millis: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html, data: https://developer.android.com/reference/kotlin/java/io/File.html#, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Create a new Entry with the contents read from a file. |
| `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#Entry(kotlin.String,%20kotlin.Long,%20kotlin.String)(tag: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, millis: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html, text: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Create a new Entry with plain text contents. |

| Public methods ||
|---|---|
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#close()()` Close the input stream associated with this entry. |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#describeContents()()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#getFlags()()` <br /> |
| open [InputStream](https://developer.android.com/reference/kotlin/java/io/InputStream.html#)? | `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#getInputStream()()` <br /> |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#getTag()()` <br /> |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#getText(kotlin.Int)(maxBytes: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` <br /> |
| open [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#getTimeMillis()()` Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#writeToParcel(android.os.Parcel,%20kotlin.Int)(out: https://developer.android.com/reference/kotlin/android/os/Parcel, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Flatten this object in to a Parcel. |

| Properties ||
|---|---|
| static [Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator)\<[DropBoxManager.Entry](https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#)!\> | `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#CREATOR:android.os.Parcelable.Creator` <br /> |

## Public constructors

### Entry

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
Entry(
    tag: String, 
    millis: Long)
```

Create a new empty Entry with no contents.

| Parameters ||
|---|---|
| `tag` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |
| `millis` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |

### Entry

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |
| `millis` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
| `data` | [ParcelFileDescriptor](https://developer.android.com/reference/kotlin/android/os/ParcelFileDescriptor)?: This value may be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_EMPTY:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_TEXT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_GZIPPED:kotlin.Int` |

### Entry

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |
| `millis` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
| `data` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)?: This value may be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_EMPTY:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_TEXT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_GZIPPED:kotlin.Int` |

### Entry

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |
| `millis` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
| `data` | [File](https://developer.android.com/reference/kotlin/java/io/File.html#): This value cannot be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_EMPTY:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_TEXT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_GZIPPED:kotlin.Int` |

### Entry

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
Entry(
    tag: String, 
    millis: Long, 
    text: String)
```

Create a new Entry with plain text contents.

| Parameters ||
|---|---|
| `tag` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |
| `millis` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
| `text` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |

## Public methods

### close

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
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 `https://developer.android.com/reference/kotlin/android/os/Parcelable#writeToParcel(android.os.Parcel,%20kotlin.Int)`, the return value of this method must include the `https://developer.android.com/reference/kotlin/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` bit.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/kotlin/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` |

### getFlags

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getFlags(): Int
```

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | flags describing the content returned by `https://developer.android.com/reference/kotlin/android/os/DropBoxManager.Entry#getInputStream()`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_EMPTY:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_TEXT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/os/DropBoxManager#IS_GZIPPED:kotlin.Int` |

### getInputStream

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getInputStream(): InputStream?
```

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/java/io/InputStream.html#?` | the uncompressed contents of the entry, or null if the contents were lost |

### getTag

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getTag(): String
```

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | the tag originally attached to the entry. This value cannot be `null`. |

### getText

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getText(maxBytes: Int): String?
```

| Parameters ||
|---|---|
| `maxBytes` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): of string to return (will truncate at this length). Value is a non-negative number of bytes. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | the uncompressed text contents of the entry, null if the entry is not text. |

### getTimeMillis

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getTimeMillis(): Long
```

Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html` | 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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/kotlin/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` |

## Properties

### CREATOR

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val CREATOR: Parcelable.Creator<DropBoxManager.Entry!>
```