apidocs / com.srv4pos.commons.io / IOUtils / toInputStream

toInputStream

open static fun toInputStream(input: String!): InputStream!

Convert the specified string to an input stream, encoded as bytes using the default character encoding of the platform.

Parameters

input - String!: the string to convert

Return
InputStream!: an input stream

Since
Commons IO 1.1

open static fun toInputStream(input: String!, encoding: String!): InputStream!

Convert the specified string to an input stream, encoded as bytes using the specified character encoding.

Character encoding names can be found at IANA.

Parameters

input - String!: the string to convert

encoding - String!: the encoding to use, null means platform default

Exceptions

IOException - if the encoding is invalid

Return
InputStream!: an input stream

Since
Commons IO 1.1