Read

An interface that defines the operations for reading file or content-related data. Extends the Serialization interface to provide additional methods for reading byte data, retrieving data sources, and determining the size of given paths.

Parameters

Path

The type that represents the file or directory path.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun extension(path: Path): String

Retrieves the file extension from the specified path.

Link copied to clipboard
abstract fun fromAbsoluteString(path: String): Path

Converts a string representation of an absolute file path into a Path object.

Link copied to clipboard
abstract fun fromRelativeString(base: Path, path: String): Path

Converts a relative path string to a Path object by resolving it against a base path.

Link copied to clipboard
abstract suspend fun name(path: Path): String

Retrieves the name of the file or directory represented by the given path.

Link copied to clipboard
abstract suspend fun read(path: Path): ByteArray

Reads the content of the file at the specified path.

Link copied to clipboard
abstract suspend fun size(path: Path): Long

Retrieves the size of the file or directory at the specified path.

Link copied to clipboard
abstract suspend fun source(path: Path): Source

Provides access to a data source represented by the given path.

Link copied to clipboard
abstract fun toAbsolutePathString(path: Path): String

Converts a given Path object into its absolute path representation as a string.

Link copied to clipboard
abstract fun toPathString(path: Path): String

Converts the given path to a string representation of the file path.