of

@NotNull
open fun of(@NotNull name: @NotNull String, bytes: Array<Byte>): @NotNull ModelAsset

Creates a new ModelAsset from a name and byte array.

Return

the created asset

Since

2.0.0

Parameters

name

the name of the asset

bytes

the byte array containing the model data


@NotNull
open fun of(@NotNull name: @NotNull String, @NotNull supplier: @NotNull ModelAsset.StreamSupplier): @NotNull ModelAsset

Creates a new ModelAsset from a name and stream supplier.

Return

the created asset

Since

2.0.0

Parameters

name

the name of the asset

supplier

the stream supplier


@NotNull
open fun of(@NotNull name: @NotNull String, sizeAssume: Long, @NotNull supplier: @NotNull ModelAsset.StreamSupplier): @NotNull ModelAsset

Creates a new ModelAsset from a name, stream supplier, and estimated size.

Return

the created asset

Since

2.0.0

Parameters

name

the name of the asset

sizeAssume

the estimated size in bytes

supplier

the stream supplier


@NotNull
open fun of(@NotNull file: @NotNull File): @NotNull ModelAsset

Creates a new ModelAsset from a file.

Return

the created asset

Since

2.0.0

Parameters

file

the source file


@NotNull
open fun of(@NotNull path: @NotNull Path): @NotNull ModelAsset

Creates a new ModelAsset from a path.

Return

the created asset

Since

2.0.0

Parameters

path

the source path

Throws

if an I/O error occurs