Entry
open class Entry : Parcelable, Closeable
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 |
|
Create a new empty Entry with no contents.
|
|
Create a new Entry with plain text contents.
|
|
Create a new Entry with byte array contents.
|
|
Create a new Entry with streaming data contents.
|
|
Create a new Entry with the contents read from a file.
|
Public constructors
<init>
Entry(
tag: String!,
millis: Long)
Create a new empty Entry with no contents.
<init>
Entry(
tag: String!,
millis: Long,
text: String!)
Create a new Entry with plain text contents.
<init>
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.
<init>
Entry(
tag: String!,
millis: Long,
data: ParcelFileDescriptor!,
flags: Int)
Create a new Entry with streaming data contents. Takes ownership of the ParcelFileDescriptor.
<init>
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.
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 |
describeContents
open fun describeContents(): Int
getFlags
open fun getFlags(): Int
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. |
getText
open fun getText(maxBytes: Int): String!
| Parameters |
maxBytes |
Int: of string to return (will truncate at this length). |
| Return |
String! |
the uncompressed text contents of the entry, null if the entry is not text. |
getTimeMillis
open fun getTimeMillis(): Long
| Return |
Long |
time when the entry was originally created. |
writeToParcel
open fun writeToParcel(
out: Parcel!,
flags: Int
): Unit
Properties