类 ZipLong

java.lang.Object
com.sh.common.zip.ZipLong
所有已实现的接口:
Cloneable

public final class ZipLong extends Object implements Cloneable
Utility class that represents a four byte integer with conversion rules for the big endian byte order of ZIP files.
  • 构造器概要

    构造器
    构造器
    说明
    ZipLong(byte[] bytes)
    Create instance from bytes.
    ZipLong(byte[] bytes, int offset)
    Create instance from the four bytes starting at offset.
    ZipLong(long value)
    Create instance from a number.
  • 方法概要

    修饰符和类型
    方法
    说明
     
    boolean
    Override to make two instances with same value equal.
    byte[]
    Get value as four bytes in big endian byte order.
    static byte[]
    getBytes(long value)
    Get value as four bytes in big endian byte order.
    long
    Get value as Java long.
    static long
    getValue(byte[] bytes)
    Helper method to get the value as a Java long from a four-byte array
    static long
    getValue(byte[] bytes, int offset)
    Helper method to get the value as a Java long from four bytes starting at given array offset
    int
    Override to make two instances with same value equal.

    从类继承的方法 java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • ZipLong

      public ZipLong(long value)
      Create instance from a number.
      参数:
      value - the long to store as a ZipLong
      从以下版本开始:
      1.1
    • ZipLong

      public ZipLong(byte[] bytes)
      Create instance from bytes.
      参数:
      bytes - the bytes to store as a ZipLong
      从以下版本开始:
      1.1
    • ZipLong

      public ZipLong(byte[] bytes, int offset)
      Create instance from the four bytes starting at offset.
      参数:
      bytes - the bytes to store as a ZipLong
      offset - the offset to start
      从以下版本开始:
      1.1
  • 方法详细资料

    • getBytes

      public byte[] getBytes()
      Get value as four bytes in big endian byte order.
      返回:
      value as four bytes in big endian order
      从以下版本开始:
      1.1
    • getValue

      public long getValue()
      Get value as Java long.
      返回:
      value as a long
      从以下版本开始:
      1.1
    • getBytes

      public static byte[] getBytes(long value)
      Get value as four bytes in big endian byte order.
      参数:
      value - the value to convert
      返回:
      value as four bytes in big endian byte order
    • getValue

      public static long getValue(byte[] bytes, int offset)
      Helper method to get the value as a Java long from four bytes starting at given array offset
      参数:
      bytes - the array of bytes
      offset - the offset to start
      返回:
      the correspondanding Java long value
    • getValue

      public static long getValue(byte[] bytes)
      Helper method to get the value as a Java long from a four-byte array
      参数:
      bytes - the array of bytes
      返回:
      the correspondanding Java long value
    • equals

      public boolean equals(Object o)
      Override to make two instances with same value equal.
      覆盖:
      equals 在类中 Object
      参数:
      o - an object to compare
      返回:
      true if the objects are equal
      从以下版本开始:
      1.1
    • hashCode

      public int hashCode()
      Override to make two instances with same value equal.
      覆盖:
      hashCode 在类中 Object
      返回:
      the value stored in the ZipLong
      从以下版本开始:
      1.1
    • clone

      public Object clone()
      覆盖:
      clone 在类中 Object