类 ZipShort
java.lang.Object
com.sh.common.zip.ZipShort
- 所有已实现的接口:
Cloneable
Utility class that represents a two byte integer with conversion
rules for the big endian byte order of ZIP files.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明clone()booleanOverride to make two instances with same value equal.byte[]getBytes()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.intgetValue()Get value as Java int.static intgetValue(byte[] bytes) Helper method to get the value as a java int from a two-byte arraystatic intgetValue(byte[] bytes, int offset) Helper method to get the value as a java int from two bytes starting at given array offsetinthashCode()Override to make two instances with same value equal.
-
构造器详细资料
-
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 ZipShortoffset- 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 bytesoffset- 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
Override to make two instances with same value equal. -
hashCode
public int hashCode()Override to make two instances with same value equal. -
clone
-