类 Npz


  • public class Npz
    extends Object
    • 构造器详细资料

      • Npz

        public Npz()
    • 方法详细资料

      • 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 file
        entry - 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 file
        fn - a consumer function of the opened NPZ file