Code cleanup
parent
0def85a2b2
commit
bac0132f0d
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
||||
/**
|
||||
|
|
|
@ -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].
|
||||
*/
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
||||
/**
|
||||
|
|
|
@ -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].
|
||||
*
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue