jina.types.arrays.mixins.io.binary module

class jina.types.arrays.mixins.io.binary.BinaryIOMixin[source]

Bases: object

Save/load an array to a binary file.

classmethod load_binary(file)[source]

Load array elements from a binary file.

Parameters

file (Union[str, BinaryIO]) – File or filename to which the data is saved.

Return type

T

Returns

a DocumentArray object

save_binary(file)[source]

Save array elements into a binary file.

Comparing to save_json(), it is faster and the file is smaller, but not human-readable.

Parameters

file (Union[str, BinaryIO]) – File or filename to which the data is saved.

Return type

None