refactored int codecs to DRY and easy support signed/unsigned values
This commit is contained in:
1 parent
0f9702b1dc
commit
8fb052c4f9
9 files changed
+148
-108
No files matched your search
@@ -1,8 +1,8 @@
|
||||
package net.sergeych.bintools
|
||||
|
||||
abstract class DataSink {
|
||||
interface DataSink {
|
||||
|
||||
abstract fun writeByte(data: Byte)
|
||||
fun writeByte(data: Byte)
|
||||
|
||||
fun writeByte(data: Int) = writeByte(data.toByte())
|
||||
|
||||
@@ -16,7 +16,7 @@ abstract class DataSink {
|
||||
}
|
||||
}
|
||||
|
||||
class ArrayDataSink : DataSink() {
|
||||
class ArrayDataSink : DataSink {
|
||||
private val result = mutableListOf<Byte>()
|
||||
|
||||
override fun writeByte(data: Byte) {
|
||||
|
||||
Reference in new issue
Block a user