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(value: String) : Number, Comparable<BigDecimal>
actual class BigDecimal(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(value: String) : Number, Comparable<BigInteger>
actual class BigInteger(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.SourceStream

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 ByteStream.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

Create a ByteStream from a file with the given range

Create a ByteStream.SourceStream that reads from this InputStream

Create a ByteStream from a path with the given range

fun File.asByteStream(start: Long = 0, endInclusive: Long = length() - 1): ByteStream

Create a ByteStream from a file

fun Path.asByteStream(start: Long = 0, endInclusive: Long = -1): ByteStream

Create a ByteStream from a path

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Create a ByteStream from a file

Link copied to clipboard

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 Flow<ByteArray>.toByteStream(scope: CoroutineScope, contentLength: Long? = null): ByteStream

Create a ByteStream from a Flow of byte arrays.

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

Return a Flow that consumes the underlying ByteStream when collected.

Link copied to clipboard

Create a blocking InputStream that reads from the underlying ByteStream.

Link copied to clipboard
suspend fun ByteStream.writeToFile(file: File): Long

Write the contents of this ByteStream to file and close it

suspend fun ByteStream.writeToFile(path: Path): Long

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

Link copied to clipboard
suspend fun ByteStream.writeToOutputStream(outputStream: OutputStream): Long

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