ByteUtils

class ByteUtils

Utility methods for reading and writing bytes.

Since

1.14

Types

Link copied to clipboard
interface ByteConsumer
Used to consume bytes.
Link copied to clipboard
interface ByteSupplier
Used to supply bytes.

Properties

Link copied to clipboard
Empty array.

Functions

Link copied to clipboard
open fun fromLittleEndian(bytes: Array<Byte>): Long
open fun fromLittleEndian(bytes: Array<Byte>, off: Int, length: Int): Long
Reads the given byte array as a little endian long.
open fun fromLittleEndian(in: DataInput, length: Int): Long
Reads the given number of bytes from the given input as little endian long.
open fun fromLittleEndian(in: InputStream, length: Int): Long
Reads the given number of bytes from the given stream as a little endian long.
open fun fromLittleEndian(supplier: ByteUtils.ByteSupplier, length: Int): Long
Reads the given number of bytes from the given supplier as a little endian long.
Link copied to clipboard
open fun toLittleEndian(out: DataOutput, value: Long, length: Int)
open fun toLittleEndian(out: OutputStream, value: Long, length: Int)
Writes the given value to the given stream as a little endian array of the given length.
open fun toLittleEndian(consumer: ByteUtils.ByteConsumer, value: Long, length: Int)
Provides the given value to the given consumer as a little endian sequence of the given length.
open fun toLittleEndian(b: Array<Byte>, value: Long, off: Int, length: Int)
Inserts the given value into the array as a little endian sequence of the given length starting at the given offset.