org.mapdb / DataIO

DataIO

class DataIO

Various IO classes and utilities..



Properties

PACK_LONG_RESULT_MASK static val PACK_LONG_RESULT_MASK: Long

Functions

arrayDelete static fun arrayDelete(vals: Array<Any>, pos: Int, len: Int): Array<Any>
static fun arrayDelete(vals: LongArray, pos: Int, len: Int): LongArray
arrayPut static fun arrayPut(array: Array<Any>, pos: Int, value: Any): Array<Any>
fillLowBits static fun fillLowBits(bitCount: Int): Long
fromHexa static fun fromHexa(s: String): ByteArray

Converts hexadecimal string into binary data

getInt static fun getInt(buf: ByteArray, pos: Int): Int
getLong static fun getLong(buf: ByteArray, pos: Int): Long
getSixLong static fun getSixLong(buf: ByteArray, pos: Int): Long
intHash static fun intHash(h: Int): Int
intToLong static fun intToLong(i: Int): Long

converts 4 int bytes to lowest 4 long bytes. Does not preserve negative flag

longHash static fun longHash(h: Long): Int
nextPowTwo static fun nextPowTwo(a: Long): Long
static fun nextPowTwo(a: Int): Int
packInt static fun packInt(out: DataOutput, value: Int): Unit

Pack int into an output stream. It will occupy 1-5 bytes depending on value (lower values occupy smaller space)

static fun packInt(buf: ByteArray, pos: Int, value: Int): Int
packIntBigger static fun packIntBigger(out: DataOutput, value: Int): Unit

Pack int into an output stream. It will occupy 1-5 bytes depending on value (lower values occupy smaller space) This method is same as #packInt(DataOutput, int), but is optimized for values larger than 127. Usually it is recids.

packLong static fun packLong(out: DataOutput, value: Long): Unit
static fun packLong(out: OutputStream, value: Long): Unit

Pack long into output. It will occupy 1-10 bytes depending on value (lower values occupy smaller space)

static fun packLong(buf: ByteArray, pos: Int, value: Long): Int
packLongSize static fun packLongSize(value: Long): Int

Calculate how much bytes packed long consumes.

packRecid static fun packRecid(out: DataOutput2, value: Long): Unit

Pack RECID into output stream with 3 bit checksum. It will occupy 1-10 bytes depending on value (lower values occupy smaller space)

parity16Get static fun parity16Get(i: Long): Long
parity16Set static fun parity16Set(i: Long): Long
parity1Get static fun parity1Get(i: Long): Long
static fun parity1Get(i: Int): Int
parity1Set static fun parity1Set(i: Long): Long
static fun parity1Set(i: Int): Int
parity3Get static fun parity3Get(i: Long): Long
parity3Set static fun parity3Set(i: Long): Long
parity4Get static fun parity4Get(i: Long): Long
parity4Set static fun parity4Set(i: Long): Long
putInt static fun putInt(buf: ByteArray, pos: Int, v: Int): Unit
putLong static fun putLong(buf: ByteArray, pos: Int, v: Long): Unit
static fun putLong(buf: ByteArray, pos: Int, v: Long, vSize: Int): Unit
putSixLong static fun putSixLong(buf: ByteArray, pos: Int, value: Long): Unit
readFully static fun readFully(in: InputStream, data: ByteArray, offset: Int, len: Int): Unit
static fun readFully(in: InputStream, data: ByteArray): Unit
roundDown static fun roundDown(number: Long, roundDownToMultipleOf: Long): Long
static fun roundDown(number: Int, roundDownToMultipleOf: Int): Int
roundUp static fun roundUp(number: Long, roundUpToMultipleOf: Long): Long
static fun roundUp(number: Int, roundUpToMultipleOf: Int): Int
shift static fun shift(value: Int): Int
skipFully static fun skipFully(in: InputStream, length: Long): Unit
toHexa static fun toHexa(bb: ByteArray): String

Converts binary array into its hexadecimal representation.

unpackInt static fun unpackInt(is: DataInput): Int
static fun unpackInt(in: InputStream): Int

Unpack int value from the input stream.

static fun unpackInt(buf: ByteArray, pos: Int): Int
unpackLong static fun unpackLong(in: DataInput): Long
static fun unpackLong(in: InputStream): Long

Unpack long value from the input stream.

static fun unpackLong(buf: ByteArray, pos: Int): Long
unpackRecid static fun unpackRecid(in: DataInput2): Long

Unpack RECID value from the input stream with 3 bit checksum.

writeFully static fun writeFully(f: FileChannel, buf: ByteBuffer): Unit