This commit is contained in:
DBotThePony 2024-02-13 16:37:20 +07:00
parent 848c402246
commit 02d368fcbf
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 12 additions and 12 deletions

View File

@ -196,42 +196,42 @@ fun InputStream.readVarIntInfo() = readVarIntInfo(::read)
/**
* Reads signed variable length integer, with Big-endian byte order
* Reads signed variable length integer, with Big-endian byte order. Sign is determined by first bit.
*/
fun RandomAccessFile.readSignedVarLong() = readVarLong(::readUnsignedByte).fromSignedVar()
/**
* Reads signed variable length integer, with Big-endian byte order
* Reads signed variable length integer, with Big-endian byte order. Sign is determined by first bit.
*/
fun RandomAccessFile.readSignedVarInt() = readVarInt(::readUnsignedByte).fromSignedVar()
/**
* Reads signed variable length integer, with Big-endian byte order
* Reads signed variable length integer, with Big-endian byte order. Sign is determined by first bit.
*/
fun RandomAccessFile.readSignedVarLongInfo() = readVarLongInfo(::readUnsignedByte).fromSignedVar()
/**
* Reads signed variable length integer, with Big-endian byte order
* Reads signed variable length integer, with Big-endian byte order. Sign is determined by first bit.
*/
fun RandomAccessFile.readSignedVarIntInfo() = readVarIntInfo(::readUnsignedByte).fromSignedVar()
/**
* Reads signed variable length integer, with Big-endian byte order
* Reads signed variable length integer, with Big-endian byte order. Sign is determined by first bit.
*/
fun InputStream.readSignedVarLong() = readVarLong(::read).fromSignedVar()
/**
* Reads signed variable length integer, with Big-endian byte order
* Reads signed variable length integer, with Big-endian byte order. Sign is determined by first bit.
*/
fun InputStream.readSignedVarInt() = readVarInt(::read).fromSignedVar()
/**
* Reads signed variable length integer, with Big-endian byte order
* Reads signed variable length integer, with Big-endian byte order. Sign is determined by first bit.
*/
fun InputStream.readSignedVarLongInfo() = readVarLongInfo(::read).fromSignedVar()
/**
* Reads signed variable length integer, with Big-endian byte order
* Reads signed variable length integer, with Big-endian byte order. Sign is determined by first bit.
*/
fun InputStream.readSignedVarIntInfo() = readVarIntInfo(::read).fromSignedVar()

View File

@ -144,22 +144,22 @@ fun OutputStream.writeVarInt(value: Int) = writeVarInt(::write, value)
/**
* Writes signed variable length integer, with Big-endian byte order
* Writes signed variable length integer, with Big-endian byte order. Sign is encoded as first bit.
*/
fun RandomAccessFile.writeSignedVarLong(value: Long) = writeVarLong(::write, value.toSignedVar())
/**
* Writes signed variable length integer, with Big-endian byte order
* Writes signed variable length integer, with Big-endian byte order. Sign is encoded as first bit.
*/
fun RandomAccessFile.writeSignedVarInt(value: Int) = writeVarInt(::write, value.toSignedVar())
/**
* Writes signed variable length integer, with Big-endian byte order
* Writes signed variable length integer, with Big-endian byte order. Sign is encoded as first bit.
*/
fun OutputStream.writeSignedVarLong(value: Long) = writeVarLong(::write, value.toSignedVar())
/**
* Writes signed variable length integer, with Big-endian byte order
* Writes signed variable length integer, with Big-endian byte order. Sign is encoded as first bit.
*/
fun OutputStream.writeSignedVarInt(value: Int) = writeVarInt(::write, value.toSignedVar())