Source

interface Source<S : Sink>(source)

Inheritors

Functions

Link copied to clipboard

Decodes an ASN.1 unsigned varint to a Asn1Integer, copying all bytes from the source into a ByteArray.

Link copied to clipboard

Decodes an ASN.1 unsigned varint to an UInt, copying all bytes from the source into a ByteArray.

Link copied to clipboard

Decodes an ASN.1 unsigned varint to an ULong, copying all bytes from the source into a ByteArray.

Link copied to clipboard
abstract fun exhausted(): Boolean
Link copied to clipboard
abstract fun peek(): Source<S>

Returns a new Source that can read data from this source without consuming it. The returned source becomes invalid once this source is next read or closed.

Link copied to clipboard

Decodes a single Asn1Element from this source.

Link copied to clipboard
Link copied to clipboard
abstract fun readByte(): Byte
Link copied to clipboard
abstract fun readByteArray(nBytes: Int): ByteArray
Link copied to clipboard

Reads all parsable ASN.1 elements from this source.

Link copied to clipboard

Consumes exactly nBytes from this source and interprets it as a signed Int

Link copied to clipboard

Consumes exactly nBytes from this source and interprets it as a Long.

Link copied to clipboard

Consumes exactly nBytes remaining data from this source and interprets it as a UInt

Link copied to clipboard

Consumes exactly nBytes from this source and interprets it as a signed ULong.

Link copied to clipboard
inline fun Source<*>.readUByte(): UByte
Link copied to clipboard
abstract fun skip(nBytes: Long)
Link copied to clipboard
abstract fun transferTo(sink: S): Long

Removes all bytes from this source, writes them to sink, and returns the total number of bytes written to sink. Return 0 if this source is exhausted.