open

expect abstract fun open(accessor: DataAccessor): T(source)

Opens and parses a file from the given data accessor.

Return

A new file instance

Parameters

accessor

The data accessor that provides access to the file content

Throws

if the file format is invalid or unsupported

if an I/O error occurs


expect open fun open(bytes: ByteArray): T(source)

Opens and parses a file from the given bytes.

Return

A new file instance

Parameters

bytes

The bytes that represent the file content

Throws

if the file format is invalid or unsupported

open fun open(path: Path): T(source)

Opens and parses a file from the given path.

Return

A new file instance

Parameters

path

The path to the file

See also

Throws

if the file format is invalid or unsupported

if an I/O error occurs

if the file does not exist


open fun open(file: File): T(source)

Opens and parses a file from the given file.

Return

A new file instance

Parameters

file

The file to open

Throws

if the file format is invalid or unsupported

if an I/O error occurs

if the file does not exist


open fun open(channel: SeekableByteChannel): T(source)

Opens and parses a file from the given channel.

The channel will be closed after the file is closed.

Return

A new file instance

Parameters

channel

The channel to open

Throws

if the file format is invalid or unsupported

if an I/O error occurs


actual abstract fun open(accessor: DataAccessor): T(source)

Opens and parses a file from the given data accessor.

Return

A new file instance

Parameters

accessor

The data accessor that provides access to the file content

Throws

if the file format is invalid or unsupported

if an I/O error occurs


actual open fun open(bytes: ByteArray): T(source)

Opens and parses a file from the given bytes.

Return

A new file instance

Parameters

bytes

The bytes that represent the file content

Throws

if the file format is invalid or unsupported

actual abstract fun open(accessor: DataAccessor): T(source)

Opens and parses a file from the given data accessor.

Return

A new file instance

Parameters

accessor

The data accessor that provides access to the file content

Throws

if the file format is invalid or unsupported

if an I/O error occurs


actual open fun open(bytes: ByteArray): T(source)

Opens and parses a file from the given bytes.

Return

A new file instance

Parameters

bytes

The bytes that represent the file content

Throws

if the file format is invalid or unsupported