Code cleanup

master
Robinson 2023-07-02 11:27:49 +02:00
parent 0def85a2b2
commit bac0132f0d
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
10 changed files with 34 additions and 23 deletions

View File

@ -71,11 +71,6 @@ object Base58 {
*/
const val version = BytesInfo.version
init {
// Add this project to the updates system, which verifies this class + UUID + version information
dorkbox.updates.Updates.add(Base58::class.java, "f176cecea06e48e1a96d59c08a6e98c3", BytesInfo.version)
}
internal const val ENCODED_ZERO = '1'
internal const val CHECKSUM_SIZE = 4

View File

@ -28,9 +28,14 @@ import java.nio.ByteBuffer
*
* arm is technically bi-endian
*/
class BigEndian {
object BigEndian {
// the following are ALL in Bit-Endian (byte[0] is MOST significant)
/**
* Gets the version number.
*/
const val version = BytesInfo.version
// NOTE: CHAR and SHORT are the exact same.
/**

View File

@ -58,11 +58,6 @@ class ByteArrayBuffer {
*/
const val version = BytesInfo.version
init {
// Add this project to the updates system, which verifies this class + UUID + version information
dorkbox.updates.Updates.add(ByteArrayBuffer::class.java, "f176cecea06e48e1a96d59c08a6e98c3", BytesInfo.version)
}
/**
* Returns the number of bytes that would be written with [.writeInt].
*/

View File

@ -29,6 +29,11 @@ class ByteArrayWrapper(
copyBytes: Boolean = true
) {
companion object {
/**
* Gets the version number.
*/
const val version = BytesInfo.version
/**
* Makes a safe copy of the byte array, so that changes to the original do not affect the wrapper.
* One side effect is that additional memory is used.

View File

@ -49,11 +49,6 @@ class ByteBufInput : Input {
* Gets the version number.
*/
const val version = BytesInfo.version
init {
// Add this project to the updates system, which verifies this class + UUID + version information
dorkbox.updates.Updates.add(ByteBufInput::class.java, "f176cecea06e48e1a96d59c08a6e98c3", BytesInfo.version)
}
}
lateinit var byteBuf: ByteBuf

View File

@ -70,11 +70,6 @@ class ByteBufOutput : Output {
* Gets the version number.
*/
const val version = BytesInfo.version
init {
// Add this project to the updates system, which verifies this class + UUID + version information
dorkbox.updates.Updates.add(ByteBufOutput::class.java, "f176cecea06e48e1a96d59c08a6e98c3", BytesInfo.version)
}
}
/**

View File

@ -19,5 +19,10 @@ object BytesInfo {
/**
* Gets the version number.
*/
const val version = "1.8"
const val version = "1.9"
init {
// Add this project to the updates system, which verifies this class + UUID + version information
dorkbox.updates.Updates.add(Hex::class.java, "f176cecea06e48e1a96d59c08a6e98c3", version)
}
}

View File

@ -28,9 +28,15 @@ import java.nio.ByteBuffer
*
* Network byte order IS big endian, as is Java.
*/
class LittleEndian {
object LittleEndian {
// the following are ALL in Little-Endian (byte[0] is LEAST significant)
/**
* Gets the version number.
*/
const val version = BytesInfo.version
// NOTE: CHAR and SHORT are the exact same.
/**

View File

@ -19,6 +19,11 @@ package dorkbox.bytes
@Suppress("unused")
object OptimizeUtilsByteArray {
/**
* Gets the version number.
*/
const val version = BytesInfo.version
/**
* Returns the number of bytes that would be written with [.writeInt].
*

View File

@ -21,6 +21,11 @@ import io.netty.buffer.ByteBuf
@Suppress("unused")
object OptimizeUtilsByteBuf {
/**
* Gets the version number.
*/
const val version = BytesInfo.version
// int
/**
* FROM KRYO