类 ZipShort

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

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

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

    修饰符和类型
    方法
    说明
     
    boolean
    Override to make two instances with same value equal.
    byte[]
    Get value as two bytes in big endian byte order.
    static byte[]
    getBytes(int value)
    Get value as two bytes in big endian byte order.
    int
    Get value as Java int.
    static int
    getValue(byte[] bytes)
    Helper method to get the value as a java int from a two-byte array
    static int
    getValue(byte[] bytes, int offset)
    Helper method to get the value as a java int from two 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
  • 构造器详细资料

    • ZipShort

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

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

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

    • getBytes

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

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

      public static byte[] getBytes(int value)
      Get value as two bytes in big endian byte order.
      参数:
      value - the Java int to convert to bytes
      返回:
      the converted int as a byte array in big endian byte order
    • getValue

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

      public static int getValue(byte[] bytes)
      Helper method to get the value as a java int from a two-byte array
      参数:
      bytes - the array of bytes
      返回:
      the correspondanding java int 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 ZipShort
      从以下版本开始:
      1.1
    • clone

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