ByteBuffersIndexOutput

class ByteBuffersIndexOutput(delegate: ByteBuffersDataOutput, resourceDescription: String, name: String, checksum: Checksum, onClose: (ByteBuffersDataOutput) -> Unit?) : IndexOutput

An IndexOutput writing to a ByteBuffersDataOutput.

Constructors

Link copied to clipboard
constructor(delegate: ByteBuffersDataOutput, resourceDescription: String, name: String, checksum: Checksum, onClose: (ByteBuffersDataOutput) -> Unit?)
constructor(delegate: ByteBuffersDataOutput, resourceDescription: String, name: String)

Properties

Link copied to clipboard
Link copied to clipboard
open override val filePointer: Long

Returns the current position in this file, where the next write will occur.

Link copied to clipboard
open var name: String?

Just the name part from resourceDescription

Functions

Link copied to clipboard
fun alignFilePointer(alignmentBytes: Int): Long

Aligns the current file pointer to multiples of alignmentBytes bytes to improve reads with mmap. This will write between 0 and (alignmentBytes-1) zero bytes using .writeByte.

Link copied to clipboard
open override fun close()

Closes this stream to further operations.

Link copied to clipboard
open override fun copyBytes(input: DataInput, numBytes: Long)

Copy numBytes bytes from input to ourself.

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

Returns the current checksum of bytes written so far

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun writeByte(b: Byte)

Writes a single byte.

Link copied to clipboard
open override fun writeBytes(b: ByteArray, length: Int)
open override fun writeBytes(b: ByteArray, offset: Int, length: Int)

Writes an array of bytes.

Link copied to clipboard
fun writeGroupVInts(values: IntArray, limit: Int)

Encode integers using group-varint. It uses VInt to encode tail values that are not enough for a group.

fun writeGroupVInts(values: LongArray, limit: Int)

Encode integers using group-varint. It uses VInt to encode tail values that are not enough for a group. we need a long[] because this is what postings are using, all longs are actually required to be integers.

Link copied to clipboard
open override fun writeInt(i: Int)

Writes an int as four bytes (LE byte order).

Link copied to clipboard
open override fun writeLong(i: Long)

Writes a long as eight bytes (LE byte order).

Link copied to clipboard
open override fun writeMapOfStrings(map: Map<String, String>)

Writes a String map.

Link copied to clipboard
open override fun writeSetOfStrings(set: MutableSet<String>)

Writes a String set.

Link copied to clipboard
open override fun writeShort(i: Short)

Writes a short as two bytes (LE byte order).

Link copied to clipboard
open override fun writeString(s: String)

Writes a string.

Link copied to clipboard
fun writeVInt(i: Int)

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

Link copied to clipboard

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

Link copied to clipboard
fun writeZInt(i: Int)

Write a zig-zag-encoded .writeVInt integer. This is typically useful to write small signed ints and is equivalent to calling writeVInt(BitUtil.zigZagEncode(i)).

Link copied to clipboard

Write a zig-zag-encoded .writeVLong long. Writes between one and ten bytes. This is typically useful to write small signed ints.