Make return type more specific for File.inputStream and File.outputStream, for String.byteInputStream

This commit is contained in:
Ilya Gorbunov
2015-12-21 04:27:05 +03:00
parent ea3a2eefe7
commit 90a33fb19c
2 changed files with 3 additions and 3 deletions
@@ -190,14 +190,14 @@ public fun File.readLines(charset: String): List<String> = readLines(Charset.for
/**
* Constructs a new FileInputStream of this file and returns it as a result.
*/
public fun File.inputStream(): InputStream {
public fun File.inputStream(): FileInputStream {
return FileInputStream(this)
}
/**
* Constructs a new FileOutputStream of this file and returns it as a result.
*/
public fun File.outputStream(): OutputStream {
public fun File.outputStream(): FileOutputStream {
return FileOutputStream(this)
}
+1 -1
View File
@@ -44,7 +44,7 @@ public operator fun BufferedInputStream.iterator(): ByteIterator =
/** Creates a new byte input stream for the string. */
public fun String.byteInputStream(charset: Charset = Charsets.UTF_8): InputStream = ByteArrayInputStream(toByteArray(charset))
public fun String.byteInputStream(charset: Charset = Charsets.UTF_8): ByteArrayInputStream = ByteArrayInputStream(toByteArray(charset))
/**
* Creates an input stream for reading data from this byte array.