translator: add println for ByteArray
This commit is contained in:
@@ -40,6 +40,16 @@ class ByteArray(var size: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun ByteArray.print() {
|
||||
println()
|
||||
var index = 0
|
||||
while (index < size) {
|
||||
println(get(index))
|
||||
index++
|
||||
}
|
||||
println()
|
||||
}
|
||||
|
||||
fun ByteArray.copyOf(newSize: Int): ByteArray {
|
||||
val newInstance = ByteArray(newSize)
|
||||
var index = 0
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import ByteArray
|
||||
import IntArray
|
||||
|
||||
/*
|
||||
* Library for console interaction
|
||||
*/
|
||||
@@ -113,6 +116,11 @@ fun println(message: String) {
|
||||
kotlinclib_println_string(message)
|
||||
}
|
||||
|
||||
/** Prints the given message and newline to the standard output stream. */
|
||||
fun println(message: ByteArray) {
|
||||
message.print()
|
||||
}
|
||||
|
||||
/** Prints newline to the standard output stream. */
|
||||
fun println() {
|
||||
kotlinclib_println()
|
||||
|
||||
Reference in New Issue
Block a user