static fun toString(input: java.io.InputStream): java.lang.String
Get the contents of an InputStream
as a String using the default character encoding of the platform.
This method buffers the input internally, so there is no need to use a BufferedInputStream
.
input
- java.io.InputStream: the InputStream
to read from
NullPointerException
- if the input is null
IOException
- if an I/O error occurs
Return
java.lang.String: the requested String
static fun toString(input: java.io.InputStream, encoding: java.lang.String): java.lang.String
Get the contents of an InputStream
as a String using the specified character encoding.
Character encoding names can be found at IANA.
This method buffers the input internally, so there is no need to use a BufferedInputStream
.
input
- java.io.InputStream: the InputStream
to read from
encoding
- java.lang.String: the encoding to use, null means platform default
NullPointerException
- if the input is null
IOException
- if an I/O error occurs
Return
java.lang.String: the requested String
static fun toString(input: java.io.Reader): java.lang.String
Get the contents of a Reader
as a String.
This method buffers the input internally, so there is no need to use a BufferedReader
.
input
- java.io.Reader: the Reader
to read from
NullPointerException
- if the input is null
IOException
- if an I/O error occurs
Return
java.lang.String: the requested String
static fun toString(input: kotlin.Array<byte>): java.lang.String
String#String(byte[])
Get the contents of a byte[]
as a String using the default character encoding of the platform.
input
- kotlin.Array<byte>: the byte array to read from
NullPointerException
- if the input is null
IOException
- if an I/O error occurs (never occurs)
Return
java.lang.String: the requested String
static fun toString(input: kotlin.Array<byte>, encoding: java.lang.String): java.lang.String
String#String(byte[],String)
Get the contents of a byte[]
as a String using the specified character encoding.
Character encoding names can be found at IANA.
input
- kotlin.Array<byte>: the byte array to read from
encoding
- java.lang.String: the encoding to use, null means platform default
NullPointerException
- if the input is null
IOException
- if an I/O error occurs (never occurs)
Return
java.lang.String: the requested String