ByteReader

interface ByteReader

An interface for reading bytes and converting them to various primitive data types.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Creates a DataInput that reads from this ByteReader.

Link copied to clipboard

Creates an InputStream that reads from this ByteReader.

Link copied to clipboard
open fun readBoolean(): Boolean

Reads a Boolean.

Link copied to clipboard
abstract fun readByte(): Byte

Reads a Byte.

Link copied to clipboard
open fun readBytes(dst: ByteArray)

Reads bytes into the dst array.

open fun readBytes(length: Int): ByteArray

Reads length amount of bytes into a new ByteArray.

open fun readBytes(dst: ByteArray, length: Int)

Reads length amount of bytes into the dst array.

abstract fun readBytes(dst: ByteArray, dstIndex: Int, length: Int)

Reads length amount of bytes into the dst array at the dstIndex offset.

Link copied to clipboard
open fun readChar(): Char

Reads a Char.

Link copied to clipboard
open fun readDouble(): Double

Reads a Double.

Link copied to clipboard
open fun readDoubleLE(): Double

Reads a Double in little endian.

Link copied to clipboard
open fun readFloat(): Float

Reads a Float.

Link copied to clipboard
open fun readFloatLE(): Float

Reads a Float in little endian.

Link copied to clipboard
open fun readInt(): Int

Reads an Int.

Link copied to clipboard
open fun readIntLE(): Int

Reads an Int in little endian.

Link copied to clipboard
open fun readLong(): Long

Reads a Long.

Link copied to clipboard
open fun readLongLE(): Long

Reads a Long in little endian.

Link copied to clipboard
open fun readMedium(): Int

Reads a medium.

Link copied to clipboard
open fun readMediumLE(): Int

Reads a medium in little endian.

Link copied to clipboard
open fun readShort(): Short

Reads a Short.

Link copied to clipboard
open fun readShortLE(): Short

Reads a Short in little endian.

Link copied to clipboard
open fun readString(): String

Reads a String.

Link copied to clipboard

Reads a UByte.

Link copied to clipboard
open fun readUnsignedInt(): UInt

Reads a UInt.

Link copied to clipboard

Reads a UInt in little endian.

Link copied to clipboard

Reads a ULong.

Link copied to clipboard

Reads a ULong in little endian.

Link copied to clipboard

Reads an unsigned medium.

Link copied to clipboard

Reads an unsigned medium in little endian.

Link copied to clipboard

Reads a UShort.

Link copied to clipboard

Read a UShort in little endian.

Link copied to clipboard

Reads a UInt in a variable length format.

Link copied to clipboard

Reads a ULong in a variable length format.

Link copied to clipboard
open fun readUUID(): UUID

Reads a UUID.

Link copied to clipboard
open fun readVarInt(): Int

Reads an Int in a variable length format.

Link copied to clipboard
open fun readVarLong(): Long

Reads a Long in a variable length format.

Link copied to clipboard
abstract fun skip(length: Int)

Skips the given amount of bytes.