translator: add println for ByteArray

This commit is contained in:
Alexey Stepanov
2016-08-16 11:05:37 +03:00
parent 14770a4485
commit ad6babd035
2 changed files with 18 additions and 0 deletions
+10
View File
@@ -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
+8
View File
@@ -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()