Entry
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 |
Create a new empty Entry with no contents.
|
Create a new Entry with streaming data contents.
|
Create a new Entry with byte array contents.
|
Create a new Entry with the contents read from a file.
|
Create a new Entry with plain text contents.
|
Public methods |
open Unit |
Close the input stream associated with this entry.
|
open Int |
|
open Int |
|
open InputStream? |
|
open String |
|
open String? |
|
open Long |
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
|
open Unit |
|
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,
data: ParcelFileDescriptor?,
flags: Int)
Create a new Entry with streaming data contents. Takes ownership of the ParcelFileDescriptor.
Entry
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.
Entry
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.
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 |
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. 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. |
writeToParcel
open fun writeToParcel(
out: Parcel,
flags: Int
): Unit
Properties