类 ZipLong
java.lang.Object
com.sh.common.zip.ZipLong
- 所有已实现的接口:
Cloneable
Utility class that represents a four 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 four bytes in big endian byte order.static byte[]getBytes(long value) Get value as four bytes in big endian byte order.longgetValue()Get value as Java long.static longgetValue(byte[] bytes) Helper method to get the value as a Java long from a four-byte arraystatic longgetValue(byte[] bytes, int offset) Helper method to get the value as a Java long from four bytes starting at given array offsetinthashCode()Override to make two instances with same value equal.
-
构造器详细资料
-
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 ZipLongoffset- 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 bytesoffset- 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
Override to make two instances with same value equal. -
hashCode
public int hashCode()Override to make two instances with same value equal. -
clone
-