Make ByteArray.inputStream a method, not a property.

#KT-8360 Fixed
This commit is contained in:
Ilya Gorbunov
2015-07-03 19:09:52 +03:00
parent 4de5dd9aeb
commit 8b325e8a30
2 changed files with 9 additions and 3 deletions
@@ -52,12 +52,18 @@ import kotlin.jvm.internal.Intrinsic
*/ */
@Intrinsic("kotlin.arrays.array") public fun booleanArrayOf(vararg content : Boolean) : BooleanArray = content @Intrinsic("kotlin.arrays.array") public fun booleanArrayOf(vararg content : Boolean) : BooleanArray = content
// TODO: Move inputStream to kotlin.io
/**
* Creates an input stream for reading data from this byte array.
*/
deprecated("Use inputStream() method instead.", ReplaceWith("this.inputStream()"))
public val ByteArray.inputStream : ByteArrayInputStream
get() = inputStream()
/** /**
* Creates an input stream for reading data from this byte array. * Creates an input stream for reading data from this byte array.
*/ */
public val ByteArray.inputStream : ByteArrayInputStream public fun ByteArray.inputStream(): ByteArrayInputStream = ByteArrayInputStream(this)
get() = ByteArrayInputStream(this)
/** /**
* Creates an input stream for reading data from the specified portion of this byte array. * Creates an input stream for reading data from the specified portion of this byte array.
+1 -1
View File
@@ -27,7 +27,7 @@ class OldStdlibTest() {
x [index] = index.toByte() x [index] = index.toByte()
} }
for(b in x.inputStream) { for(b in x.inputStream()) {
println(b) println(b)
} }
} }