类 Npz
- java.lang.Object
-
- org.meteoinfo.ndarray.io.npy.Npz
-
public class Npz extends Object
-
-
构造器概要
构造器 构造器 说明 Npz()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static ZipOutputStreamcreate(File file)static voidcreate(File file, Consumer<ZipOutputStream> fn)static ZipOutputStreamcreate(String fileName)static List<String>entries(File npz)Returns the names of the entries of the given NPZ file.static List<String>entries(String fileName)Returns the names of the entries of the given NPZ file.static List<String>entries(ZipFile npz)Returns the names of the entries of the given NPZ file.static Arrayload(ZipFile npz, String entry)Read an array from an entry of a NPZ file.static ZipFileopen(String fileName)Open npz data filestatic voiduse(File npz, Consumer<ZipFile> fn)Open the given file as an NPZ file.static voidwrite(ZipOutputStream npz, String entry, Array array)
-
-
-
方法详细资料
-
open
public static ZipFile open(String fileName)
Open npz data file- 参数:
fileName- The file name- 返回:
- ZipFile object
-
entries
public static List<String> entries(String fileName)
Returns the names of the entries of the given NPZ file.- 参数:
fileName- a NPZ file name- 返回:
- the names of the entries of the NPZ file
-
entries
public static List<String> entries(File npz)
Returns the names of the entries of the given NPZ file.- 参数:
npz- a NPZ file- 返回:
- the names of the entries of the NPZ file
-
entries
public static List<String> entries(ZipFile npz)
Returns the names of the entries of the given NPZ file.- 参数:
npz- a NPZ file- 返回:
- the names of the entries of the NPZ file
-
load
public static Array load(ZipFile npz, String entry)
Read an array from an entry of a NPZ file.- 参数:
npz- the NPZ fileentry- the name of the entry in which the array is stored- 返回:
- the array of the entry
-
use
public static void use(File npz, Consumer<ZipFile> fn)
Open the given file as an NPZ file. This function is useful when you want to do multiple things with a NPZ file, e.g.Npz.use(file, npz -> { for (var entry : Npz.entries(npz)) { var array = Npz.read(npz, entry); // ... } });- 参数:
npz- the NPZ filefn- a consumer function of the opened NPZ file
-
create
public static void create(File file, Consumer<ZipOutputStream> fn)
-
create
public static ZipOutputStream create(File file)
-
create
public static ZipOutputStream create(String fileName)
-
write
public static void write(ZipOutputStream npz, String entry, Array array)
-
-