ditto-lib / live.ditto / DittoAttachment

DittoAttachment

class DittoAttachment : Closeable

Represents an attachment and can be used to insert the associated attachment into a document at a specific key.

Parameters

metadata - the attachment's metadata.

Properties

metadata

val metadata: Map<String, String>

the attachment's metadata.

Functions

close

fun close(): Unit

copyToPath

fun copyToPath(path: String): Unit

Copies the attachment to the specified file path.

getData

fun getData(): ByteArray

Returns the attachment's data as a ByteArray.

getInputStream

fun getInputStream(): FileInputStream

Returns an input stream for the attachment file.