ByteArrayDataInput

DataInput backed by a byte array. WARNING: This class omits all low-level checks.

Constructors

Link copied to clipboard
constructor(bytes: ByteArray)
constructor(bytes: ByteArray, offset: Int, len: Int)
constructor()

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun clone(): DataInput

Returns a clone of this stream.

Link copied to clipboard
fun eof(): Boolean
Link copied to clipboard
fun length(): Int
Link copied to clipboard
open override fun readByte(): Byte

Reads and returns a single byte.

Link copied to clipboard
open override fun readBytes(b: ByteArray, offset: Int, len: Int)

Reads a specified number of bytes into an array at the specified offset.

open fun readBytes(b: ByteArray, offset: Int, len: Int, useBuffer: Boolean)

Reads a specified number of bytes into an array at the specified offset with control over whether the read should be buffered (callers who have their own buffer should pass in "false" for useBuffer). Currently only BufferedIndexInput respects this parameter.

Link copied to clipboard
open fun readFloats(floats: FloatArray, offset: Int, len: Int)

Reads a specified number of floats into an array at the specified offset.

Link copied to clipboard
open fun readGroupVInt(dst: IntArray, offset: Int)

Override if you have an efficient implementation. In general this is when the input supports random access.

Link copied to clipboard
open override fun readInt(): Int

Reads four bytes and returns an int (LE byte order).

Link copied to clipboard
open fun readInts(dst: IntArray, offset: Int, length: Int)

Reads a specified number of ints into an array at the specified offset.

Link copied to clipboard
open override fun readLong(): Long

Reads eight bytes and returns a long (LE byte order).

Link copied to clipboard
open fun readLongs(dst: LongArray, offset: Int, length: Int)

Read a specified number of longs.

Link copied to clipboard

Reads a Map previously written with .

Link copied to clipboard

Reads a Set previously written with DataOutput.writeSetOfStrings.

Link copied to clipboard
open override fun readShort(): Short

Reads two bytes and returns a short (LE byte order).

Link copied to clipboard
open fun readString(): String

Reads a string.

Link copied to clipboard
open override fun readVInt(): Int

Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are supported, but should be avoided.

Link copied to clipboard
open override fun readVLong(): Long

Reads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Link copied to clipboard
open fun readZInt(): Int

Read a zig-zag-encoded .readVInt integer.

Link copied to clipboard
open fun readZLong(): Long

Read a zig-zag-encoded .readVLong integer. Reads between one and ten bytes.

Link copied to clipboard
fun reset(bytes: ByteArray, offset: Int = 0, len: Int = bytes.size)
Link copied to clipboard
fun rewind()
Link copied to clipboard
open override fun skipBytes(count: Long)

Skip over numBytes bytes. This method may skip bytes in whatever way is most optimal, and may not have the same behavior as reading the skipped bytes. In general, negative numBytes are not supported.