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

readLines

open static fun readLines(input: InputStream!): MutableList<Any?>!

Get the contents of an InputStream as a list of Strings, one entry per line, using the default character encoding of the platform.

This method buffers the input internally, so there is no need to use a BufferedInputStream.

Parameters

input - InputStream!: the InputStream to read from, not null

Exceptions

NullPointerException - if the input is null

IOException - if an I/O error occurs

Return
MutableList<Any?>!: the list of Strings, never null

Since
Commons IO 1.1

open static fun readLines(input: InputStream!, encoding: String!): MutableList<Any?>!

Get the contents of an InputStream as a list of Strings, one entry per line, 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.

Parameters

input - InputStream!: the InputStream to read from, not null

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

Exceptions

NullPointerException - if the input is null

IOException - if an I/O error occurs

Return
MutableList<Any?>!: the list of Strings, never null

Since
Commons IO 1.1

open static fun readLines(input: Reader!): MutableList<Any?>!

Get the contents of a Reader as a list of Strings, one entry per line.

This method buffers the input internally, so there is no need to use a BufferedReader.

Parameters

input - Reader!: the Reader to read from, not null

Exceptions

NullPointerException - if the input is null

IOException - if an I/O error occurs

Return
MutableList<Any?>!: the list of Strings, never null

Since
Commons IO 1.1