fix padding
again
This commit is contained in:
@@ -40,10 +40,10 @@ fun ByteArray.padStart(
|
||||
padByte: Byte,
|
||||
): ByteArray {
|
||||
return buildList {
|
||||
repeat(length - size) {
|
||||
repeat(length - this@padStart.size) {
|
||||
add(padByte)
|
||||
}
|
||||
addAll(this)
|
||||
addAll(this@padStart)
|
||||
}.toByteArray()
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ fun ByteArray.padEnd(
|
||||
padByte: Byte,
|
||||
): ByteArray {
|
||||
return buildList {
|
||||
addAll(this)
|
||||
repeat(length - size) {
|
||||
addAll(this@padEnd)
|
||||
repeat(length - this@padEnd.size) {
|
||||
add(padByte)
|
||||
}
|
||||
}.toByteArray()
|
||||
|
||||
Reference in New Issue
Block a user