ByteArraySink

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun appendUnsafe(bytes: ByteArray, startIndex: Int, endIndex: Int): Int

Directly appends bytes to this Sink's internal Buffer without copying. Thus, it keeps bytes managed by a Buffer accessible. The bytes may be overwritten through the Buffer or even recycled to be used by another buffer. Therefore, operating on these bytes after wrapping leads to undefined behaviour. startIndex is inclusive, endIndex is exclusive.

Link copied to clipboard
Link copied to clipboard
open override fun write(bytes: ByteArray, startIndex: Int, endIndex: Int)
Link copied to clipboard

Encodes this number using varint encoding as used within ASN.1: groups of seven bits are encoded into a byte, while the highest bit indicates if more bytes are to come

Encodes this number using varint encoding as used within ASN.1: groups of seven bits are encoded into a byte, while the highest bit indicates if more bytes are to come

Link copied to clipboard
open override fun writeByte(byte: Byte)
Link copied to clipboard

Encodes a positive Long to a minimum-size unsigned byte array, omitting the leading zero

Link copied to clipboard

Writes a signed long using twos-complement encoding using the fewest bytes required

Link copied to clipboard

Encodes an unsigned Int to a minimum-size twos-complement byte array

Link copied to clipboard

Encodes an unsigned Long to a minimum-size twos-complement byte array

Link copied to clipboard
inline fun Sink.writeUByte(uByte: UByte)