Package-level declarations

Types

Link copied to clipboard
expect class BigDecimal(value: String) : Number, Comparable<BigDecimal>

A floating point decimal number with arbitrary precision.

actual class BigDecimal(val value: String) : Number, Comparable<BigDecimal>
Link copied to clipboard
expect class BigInteger(value: String) : Number, Comparable<BigInteger>

An arbitrarily large signed integer

actual class BigInteger(val value: String) : Number, Comparable<BigInteger>
Link copied to clipboard
sealed class ByteStream

Represents an abstract read-only stream of bytes

Link copied to clipboard
sealed class Document

A Document is used to store arbitrary or unstructured data.

Link copied to clipboard
Link copied to clipboard
class FileContent(val file: File, val start: Long = 0, val endInclusive: Long = file.length() - 1)

ByteStream backed by a local file

Functions

Link copied to clipboard

Builds a Document with the given builder.

Link copied to clipboard

Construct a Document from a Boolean.

fun Document(value: Number): Document

Construct a Document from a Number of arbitrary precision.

fun Document(value: String): Document

Construct a Document from a String.

Construct a Document from a List.

Construct a Document from a Map.

Inherited functions

Link copied to clipboard
suspend fun <Error class: unknown class>.appendToOutputStream(outputStream: OutputStream): Long

Writes this stream to the given OutputStream. This method does not flush or close the given OutputStream.

Link copied to clipboard
fun File.asByteStream(range: LongRange): <Error class: unknown class>

Create a ByteStream from a file with the given range

fun InputStream.asByteStream(contentLength: Long? = null): <Error class: unknown class>

Create a ByteStream.SourceStream that reads from this InputStream

fun Path.asByteStream(range: LongRange): <Error class: unknown class>

Create a ByteStream from a path with the given range

fun File.asByteStream(start: Long = 0, endInclusive: Long = length() - 1): <Error class: unknown class>

Create a ByteStream from a file

fun Path.asByteStream(start: Long = 0, endInclusive: Long = -1): <Error class: unknown class>

Create a ByteStream from a path

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <Error class: unknown class>.fromFile(file: File): <Error class: unknown class>

Create a ByteStream from a file

Link copied to clipboard
fun <Error class: unknown class>.fromInputStream(inputStream: InputStream, contentLength: Long? = null): <Error class: unknown class>

Create a ByteStream.SourceStream that reads from the given InputStream

Link copied to clipboard

Consume the ByteStream and pull the entire contents into memory as a ByteArray. Only do this if you are sure the contents fit in-memory as this will read the entire contents of a streaming variant.

Link copied to clipboard
fun <Error class: unknown class><ByteArray>.toByteStream(scope: <Error class: unknown class>, contentLength: Long? = null): ByteStream

Create a ByteStream from a Flow of byte arrays.

Link copied to clipboard
fun ByteStream.toFlow(bufferSize: Long = 8192): <Error class: unknown class><ByteArray>

Return a Flow that consumes the underlying ByteStream when collected.

Link copied to clipboard
fun <Error class: unknown class>.toInputStream(): InputStream

Create a blocking InputStream that reads from the underlying ByteStream.

Link copied to clipboard
suspend fun <Error class: unknown class>.writeToFile(file: File): Long

Write the contents of this ByteStream to file and close it

suspend fun <Error class: unknown class>.writeToFile(path: Path): Long

Write the contents of this ByteStream to file at the given path

Link copied to clipboard
suspend fun <Error class: unknown class>.writeToOutputStream(outputStream: OutputStream): Long

Writes this stream to the given OutputStream, then closes it.