ZTBuffer

class ZTBuffer

ZTBuffer represents a byte buffer with commons operations, such as node js buffer library.

Author

Alexandre Lemoult <a.lemoult@zhortech.com>

Constructors

ZTBuffer
Link copied to clipboard
fun ZTBuffer(byteBuffer: ByteBuffer)
ZTBuffer
Link copied to clipboard
fun ZTBuffer(byteArray: ByteArray)

Types

Companion
Link copied to clipboard
object Companion

Functions

getByteArray
Link copied to clipboard
fun getByteArray(): ByteArray
readDoubleBE
Link copied to clipboard
fun readDoubleBE(offset: Int): Double
Reads a Double in BIG_ENDIAN.
readDoubleLE
Link copied to clipboard
fun readDoubleLE(offset: Int): Double
Reads a Double in LITTLE_ENDIAN.
readFloatBE
Link copied to clipboard
fun readFloatBE(offset: Int): Float
Reads a Float in BIG_ENDIAN.
readFloatLE
Link copied to clipboard
fun readFloatLE(offset: Int): Float
Reads a Float in LITTLE_ENDIAN.
readInt16BE
Link copied to clipboard
fun readInt16BE(offset: Int): Short
Reads a Int16 in BIG_ENDIAN.
readInt16LE
Link copied to clipboard
fun readInt16LE(offset: Int): Short
Reads a Int16 in LITTLE_ENDIAN.
readInt32BE
Link copied to clipboard
fun readInt32BE(offset: Int): Int
Reads a Int32 in BIG_ENDIAN.
readInt32LE
Link copied to clipboard
fun readInt32LE(offset: Int): Int
Reads a Int32 in LITTLE_ENDIAN.
readInt8
Link copied to clipboard
fun readInt8(offset: Int): Byte
Reads an Int8.
readUInt16BE
Link copied to clipboard
fun readUInt16BE(offset: Int): Byte
Reads a UInt16 in BIG_ENDIAN.
readUInt16LE
Link copied to clipboard
fun readUInt16LE(offset: Int): Short
Reads a UInt16 in LITTLE_ENDIAN.
readUInt32LE
Link copied to clipboard
fun readUInt32LE(offset: Int): Int
Reads a UInt32 in LITTLE_ENDIAN.
readUInt8
Link copied to clipboard
fun readUInt8(offset: Int): Byte
Reads a UInt8.
toString
Link copied to clipboard
open override fun toString(): String
Buffer to string.
writeUInt32LE
Link copied to clipboard
fun writeUInt32LE(value: Int, offset: Int = 0): ZTBuffer
Write a UInt32 in LITTLE_ENDIAN.