Make return type more specific for File.inputStream and File.outputStream, for String.byteInputStream
This commit is contained in:
@@ -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.
|
* 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)
|
return FileInputStream(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new FileOutputStream of this file and returns it as a result.
|
* 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)
|
return FileOutputStream(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public operator fun BufferedInputStream.iterator(): ByteIterator =
|
|||||||
|
|
||||||
|
|
||||||
/** Creates a new byte input stream for the string. */
|
/** 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.
|
* Creates an input stream for reading data from this byte array.
|
||||||
|
|||||||
Reference in New Issue
Block a user