translator: purifier println for Byte and Int Arrays
This commit is contained in:
@@ -41,12 +41,21 @@ class ByteArray(var size: Int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun ByteArray.print() {
|
fun ByteArray.print() {
|
||||||
println()
|
|
||||||
var index = 0
|
var index = 0
|
||||||
|
print('[')
|
||||||
while (index < size) {
|
while (index < size) {
|
||||||
println(get(index))
|
print(get(index))
|
||||||
index++
|
index++
|
||||||
|
if (index < size){
|
||||||
|
print(';')
|
||||||
|
print(' ')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
print(']')
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ByteArray.println() {
|
||||||
|
this.print()
|
||||||
println()
|
println()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,16 @@ fun print(message: String) {
|
|||||||
kotlinclib_print_string(message)
|
kotlinclib_print_string(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Prints the given message and newline to the standard output stream. */
|
||||||
|
fun print(message: ByteArray) {
|
||||||
|
message.print()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Prints the given message and newline to the standard output stream. */
|
||||||
|
fun print(message: IntArray) {
|
||||||
|
message.print()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Prints the given message and newline to the standard output stream. */
|
/** Prints the given message and newline to the standard output stream. */
|
||||||
fun println(message: Int) {
|
fun println(message: Int) {
|
||||||
@@ -118,7 +128,12 @@ fun println(message: String) {
|
|||||||
|
|
||||||
/** Prints the given message and newline to the standard output stream. */
|
/** Prints the given message and newline to the standard output stream. */
|
||||||
fun println(message: ByteArray) {
|
fun println(message: ByteArray) {
|
||||||
message.print()
|
message.println()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Prints the given message and newline to the standard output stream. */
|
||||||
|
fun println(message: IntArray) {
|
||||||
|
message.println()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Prints newline to the standard output stream. */
|
/** Prints newline to the standard output stream. */
|
||||||
|
|||||||
@@ -39,6 +39,26 @@ class IntArray(var size: Int) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun IntArray.print() {
|
||||||
|
var index = 0
|
||||||
|
print('[')
|
||||||
|
while (index < size) {
|
||||||
|
print(get(index))
|
||||||
|
index++
|
||||||
|
if (index < size) {
|
||||||
|
print(';')
|
||||||
|
print(' ')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print(']')
|
||||||
|
}
|
||||||
|
|
||||||
|
fun IntArray.println() {
|
||||||
|
this.print()
|
||||||
|
println()
|
||||||
|
}
|
||||||
|
|
||||||
fun IntArray.copyOf(newSize: Int): IntArray {
|
fun IntArray.copyOf(newSize: Int): IntArray {
|
||||||
val newInstance = IntArray(newSize)
|
val newInstance = IntArray(newSize)
|
||||||
var index = 0
|
var index = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user