diff --git a/src/dorkbox/bytes/Base58.kt b/src/dorkbox/bytes/Base58.kt index 8a5f424..9d5b72e 100644 --- a/src/dorkbox/bytes/Base58.kt +++ b/src/dorkbox/bytes/Base58.kt @@ -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 diff --git a/src/dorkbox/bytes/BigEndian.kt b/src/dorkbox/bytes/BigEndian.kt index 34995e0..ff1d35f 100644 --- a/src/dorkbox/bytes/BigEndian.kt +++ b/src/dorkbox/bytes/BigEndian.kt @@ -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. /** diff --git a/src/dorkbox/bytes/ByteArrayBuffer.kt b/src/dorkbox/bytes/ByteArrayBuffer.kt index b5961ff..c25d077 100644 --- a/src/dorkbox/bytes/ByteArrayBuffer.kt +++ b/src/dorkbox/bytes/ByteArrayBuffer.kt @@ -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]. */ diff --git a/src/dorkbox/bytes/ByteArrayWrapper.kt b/src/dorkbox/bytes/ByteArrayWrapper.kt index c954f89..dfe35f5 100644 --- a/src/dorkbox/bytes/ByteArrayWrapper.kt +++ b/src/dorkbox/bytes/ByteArrayWrapper.kt @@ -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. diff --git a/src/dorkbox/bytes/ByteBufInput.kt b/src/dorkbox/bytes/ByteBufInput.kt index d2544c6..d052555 100644 --- a/src/dorkbox/bytes/ByteBufInput.kt +++ b/src/dorkbox/bytes/ByteBufInput.kt @@ -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 diff --git a/src/dorkbox/bytes/ByteBufOutput.kt b/src/dorkbox/bytes/ByteBufOutput.kt index 2ad256b..8e7e4a2 100644 --- a/src/dorkbox/bytes/ByteBufOutput.kt +++ b/src/dorkbox/bytes/ByteBufOutput.kt @@ -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) - } } /** diff --git a/src/dorkbox/bytes/BytesInfo.kt b/src/dorkbox/bytes/BytesInfo.kt index 717f186..443ce5f 100644 --- a/src/dorkbox/bytes/BytesInfo.kt +++ b/src/dorkbox/bytes/BytesInfo.kt @@ -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) + } } diff --git a/src/dorkbox/bytes/LittleEndian.kt b/src/dorkbox/bytes/LittleEndian.kt index ebaa7f4..a2d5846 100644 --- a/src/dorkbox/bytes/LittleEndian.kt +++ b/src/dorkbox/bytes/LittleEndian.kt @@ -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. /** diff --git a/src/dorkbox/bytes/OptimizeUtilsByteArray.kt b/src/dorkbox/bytes/OptimizeUtilsByteArray.kt index 729aa46..6ca19e8 100644 --- a/src/dorkbox/bytes/OptimizeUtilsByteArray.kt +++ b/src/dorkbox/bytes/OptimizeUtilsByteArray.kt @@ -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]. * diff --git a/src/dorkbox/bytes/OptimizeUtilsByteBuf.kt b/src/dorkbox/bytes/OptimizeUtilsByteBuf.kt index 95175b8..8d55e53 100644 --- a/src/dorkbox/bytes/OptimizeUtilsByteBuf.kt +++ b/src/dorkbox/bytes/OptimizeUtilsByteBuf.kt @@ -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