Model.ModelLocation

  • The Model.ModelLocation class provides methods for specifying where to load a model from.

  • Models can be loaded from an AssetFileDescriptor, ByteBuffer, File, raw file descriptor, or a file path.

  • Loading from a ByteBuffer requires it to be a MappedByteBuffer or a direct ByteBuffer in native byte order, otherwise an IllegalArgumentException is thrown.

public static class Model.ModelLocation extends Object

Where to load the model from.

Public Method Summary

static Model.ModelLocation
fromAssetFileDescriptor(AssetFileDescriptor assetFileDescriptor)
Loads file from a AssetFileDescriptor.
static Model.ModelLocation
fromByteBuffer(ByteBuffer byteBuffer)
Loads model from ByteBuffer.
static Model.ModelLocation
fromFile(File file)
Loads model from File.
static Model.ModelLocation
fromFileDescriptor(long fileDescriptor, long startOffset, long modelLength)
Loads file from a raw file descriptor.
static Model.ModelLocation
fromFilePath(String filePath)
Loads model from a file path.

Inherited Method Summary

Public Methods

public static Model.ModelLocation fromAssetFileDescriptor (AssetFileDescriptor assetFileDescriptor)

Loads file from a AssetFileDescriptor.

public static Model.ModelLocation fromByteBuffer (ByteBuffer byteBuffer)

Loads model from ByteBuffer.

Throws
IllegalArgumentException if byteBuffer is not of type MappedByteBuffer or not a direct ByteBuffer in ByteOrder.nativeOrder().

public static Model.ModelLocation fromFile (File file)

Loads model from File.

public static Model.ModelLocation fromFileDescriptor (long fileDescriptor, long startOffset, long modelLength)

Loads file from a raw file descriptor.

public static Model.ModelLocation fromFilePath (String filePath)

Loads model from a file path.