Blob

expect constructor(contentType: String, stream: Source)(source)

Construct a Blob with the given stream of data. The passed stream will be closed when it is copied either to memory (see getContent) or to the database. If it is closed before that, by client code, the attempt to store the blob will fail. The converse is also true: the stream for a blob that is not saved or copied to memory will not be closed (except during garbage collection).

Parameters

contentType

The type of content this Blob will represent

stream

The stream of data that this Blob will consume


expect constructor(contentType: String, fileURL: String)(source)

Construct a Blob with the content of a file. The blob can then be added as a property of a Document. This constructor creates a stream that is not closed until the blob is stored in the db, or copied to memory (except by garbage collection).

Parameters

contentType

The type of content this Blob will represent

fileURL

A URL to a file containing the data that this Blob will represent.

Throws

on failure to open the file URL


expect constructor(contentType: String, content: ByteArray)(source)
actual constructor(contentType: String, stream: Source)(source)
actual constructor(contentType: String, fileURL: String)(source)
actual constructor(contentType: String, content: ByteArray)(source)
actual constructor(contentType: String, stream: Source)(source)
actual constructor(contentType: String, fileURL: String)(source)
actual constructor(contentType: String, content: ByteArray)(source)