类 NpyHeaderDict


  • public class NpyHeaderDict
    extends Object
    Contains the values of the dictionary that is stored in the header of an NPY file.
    • 方法详细资料

      • typeSize

        public int typeSize()
        Describes the size of the stored type. The meaning of this field depends on the respective storage type. For numeric types it is in general the number of bytes which are required to store a single value. For strings, it is the number of characters of the string (note that for unicode strings 4 bytes are used to store a single character in NPY and that ASCII strings are stored with an additional null-termination byte).
        返回:
        the size of the stored type.
      • hasFortranOrder

        public boolean hasFortranOrder()
        Returns true when the array is stored in Fortran order.
      • dimensions

        public int dimensions()
        Returns the number of dimensions of the array..
      • sizeOfDimension

        public int sizeOfDimension​(int i)
        Returns the size if the ith dimension of the array.
        参数:
        i - the 0-based dimension for which the size is requested.
        返回:
        the size of the requested dimension
        抛出:
        IndexOutOfBoundsException - if i < 0 || i >= dimensions()
      • dataSize

        public long dataSize()
        Returns the size of the stored array in number of bytes. That is the number of elements of the stored array times the size of the data type in bytes.
        返回:
        the size of the stored array in bytes
      • numberOfElements

        public int numberOfElements()
        Returns the number of elements that are stored in the array.
        返回:
        the number of elements which is the product of all dimension sizes.
      • shape

        public int[] shape()
        Returns the shape of the stored array. Note that this returns a new allocated array each time you call this method.
        返回:
        the shape of the stored array
      • toNpyHeader

        public byte[] toNpyHeader()