Top Description Fields Constructors Methods
org.apache.commons.compress.archivers.zip

public final Class ZipEightByteInteger

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Static Imports
org.apache.commons.compress.archivers.zip.ZipConstants.BYTE_MASK

Utility class that represents an eight byte integer with conversion rules for the little-endian byte order of ZIP files.
Since
1.2

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final long
private static final int
private static final int
private static final long
private static final int
private static final int
private static final long
private static final int
private static final int
private static final long
private static final int
private static final int
private static final long
private static final int
private static final byte
private static final int
private static final long
private final BigInteger
public static final ZipEightByteInteger

Constructor Summary

AccessConstructor and Description
public
ZipEightByteInteger(final BigInteger
the BigInteger to store as a ZipEightByteInteger
value
)

Constructs a new instance from a number.

public
ZipEightByteInteger(final byte[]
the bytes to store as a ZipEightByteInteger
bytes
)

Constructs a new instance from bytes.

public
ZipEightByteInteger(final byte[]
the bytes to store as a ZipEightByteInteger
bytes
,
final int
the offset to start
offset
)

Constructs a new instance from the eight bytes starting at offset.

public
ZipEightByteInteger(final long
the long to store as a ZipEightByteInteger
value
)

Constructs a new instance from a number.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the objects are equal
equals
(final Object
an object to compare
o
)

Overrides java.lang.Object.equals.

Override to make two instances with same value equal.
public static byte[]

Returns:

value as eight bytes in big-endian byte order
getBytes
(final BigInteger
the value to convert
value
)

Gets value as eight bytes in big-endian byte order.

public static byte[]

Returns:

value as eight bytes in big-endian byte order
getBytes
(final long
the value to convert
value
)

Gets value as eight bytes in big-endian byte order.

public byte[]

Returns:

value as eight bytes in big-endian order
getBytes
()

Gets value as eight bytes in big-endian byte order.

public static long

Returns:

the corresponding Java long value
getLongValue
(final byte[]
the array of bytes
bytes
)

Helper method to get the value as a Java long from an eight-byte array

public static long

Returns:

the corresponding Java long value
getLongValue
(final byte[]
the array of bytes
bytes
,
final int
the offset to start
offset
)

Helper method to get the value as a Java long from eight bytes starting at given array offset

public long

Returns:

value as a long
getLongValue
()

Gets value as Java long.

public static BigInteger

Returns:

the corresponding Java BigInteger value
getValue
(final byte[]
the array of bytes
bytes
)

Helper method to get the value as a Java long from an eight-byte array

public static BigInteger

Returns:

the corresponding Java BigInteger value
getValue
(final byte[]
the array of bytes
bytes
,
final int
the offset to start
offset
)

Helper method to get the value as a Java BigInteger from eight bytes starting at given array offset

public BigInteger

Returns:

value as a BigInteger
getValue
()

Gets value as Java BigInteger.

public int

Returns:

the hash code of the value stored in the ZipEightByteInteger
hashCode
()

Overrides java.lang.Object.hashCode.

Override to make two instances with same value equal.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

BYTE_1back to summary
private static final int BYTE_1
BYTE_1_MASKback to summary
private static final int BYTE_1_MASK
BYTE_1_SHIFTback to summary
private static final int BYTE_1_SHIFT
BYTE_2back to summary
private static final int BYTE_2
BYTE_2_MASKback to summary
private static final int BYTE_2_MASK
BYTE_2_SHIFTback to summary
private static final int BYTE_2_SHIFT
BYTE_3back to summary
private static final int BYTE_3
BYTE_3_MASKback to summary
private static final long BYTE_3_MASK
BYTE_3_SHIFTback to summary
private static final int BYTE_3_SHIFT
BYTE_4back to summary
private static final int BYTE_4
BYTE_4_MASKback to summary
private static final long BYTE_4_MASK
BYTE_4_SHIFTback to summary
private static final int BYTE_4_SHIFT
BYTE_5back to summary
private static final int BYTE_5
BYTE_5_MASKback to summary
private static final long BYTE_5_MASK
BYTE_5_SHIFTback to summary
private static final int BYTE_5_SHIFT
BYTE_6back to summary
private static final int BYTE_6
BYTE_6_MASKback to summary
private static final long BYTE_6_MASK
BYTE_6_SHIFTback to summary
private static final int BYTE_6_SHIFT
BYTE_7back to summary
private static final int BYTE_7
BYTE_7_MASKback to summary
private static final long BYTE_7_MASK
BYTE_7_SHIFTback to summary
private static final int BYTE_7_SHIFT
LEFTMOST_BITback to summary
private static final byte LEFTMOST_BIT
LEFTMOST_BIT_SHIFTback to summary
private static final int LEFTMOST_BIT_SHIFT
serialVersionUIDback to summary
private static final long serialVersionUID
valueback to summary
private final BigInteger value
ZEROback to summary
public static final ZipEightByteInteger ZERO

Constructor Detail

ZipEightByteIntegerback to summary
public ZipEightByteInteger(final BigInteger value)

Constructs a new instance from a number.

Parameters
value:BigInteger

the BigInteger to store as a ZipEightByteInteger

ZipEightByteIntegerback to summary
public ZipEightByteInteger(final byte[] bytes)

Constructs a new instance from bytes.

Parameters
bytes:byte[]

the bytes to store as a ZipEightByteInteger

ZipEightByteIntegerback to summary
public ZipEightByteInteger(final byte[] bytes, final int offset)

Constructs a new instance from the eight bytes starting at offset.

Parameters
bytes:byte[]

the bytes to store as a ZipEightByteInteger

offset:int

the offset to start

ZipEightByteIntegerback to summary
public ZipEightByteInteger(final long value)

Constructs a new instance from a number.

Parameters
value:long

the long to store as a ZipEightByteInteger

Method Detail

equalsback to summary
public boolean equals(final Object o)

Overrides java.lang.Object.equals.

Override to make two instances with same value equal.

Parameters
o:Object

an object to compare

Returns:boolean

true if the objects are equal

Annotations
@Override
getBytesback to summary
public static byte[] getBytes(final BigInteger value)

Gets value as eight bytes in big-endian byte order.

Parameters
value:BigInteger

the value to convert

Returns:byte[]

value as eight bytes in big-endian byte order

getBytesback to summary
public static byte[] getBytes(final long value)

Gets value as eight bytes in big-endian byte order.

Parameters
value:long

the value to convert

Returns:byte[]

value as eight bytes in big-endian byte order

getBytesback to summary
public byte[] getBytes()

Gets value as eight bytes in big-endian byte order.

Returns:byte[]

value as eight bytes in big-endian order

getLongValueback to summary
public static long getLongValue(final byte[] bytes)

Helper method to get the value as a Java long from an eight-byte array

Parameters
bytes:byte[]

the array of bytes

Returns:long

the corresponding Java long value

getLongValueback to summary
public static long getLongValue(final byte[] bytes, final int offset)

Helper method to get the value as a Java long from eight bytes starting at given array offset

Parameters
bytes:byte[]

the array of bytes

offset:int

the offset to start

Returns:long

the corresponding Java long value

getLongValueback to summary
public long getLongValue()

Gets value as Java long.

Returns:long

value as a long

getValueback to summary
public static BigInteger getValue(final byte[] bytes)

Helper method to get the value as a Java long from an eight-byte array

Parameters
bytes:byte[]

the array of bytes

Returns:BigInteger

the corresponding Java BigInteger value

getValueback to summary
public static BigInteger getValue(final byte[] bytes, final int offset)

Helper method to get the value as a Java BigInteger from eight bytes starting at given array offset

Parameters
bytes:byte[]

the array of bytes

offset:int

the offset to start

Returns:BigInteger

the corresponding Java BigInteger value

getValueback to summary
public BigInteger getValue()

Gets value as Java BigInteger.

Returns:BigInteger

value as a BigInteger

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Override to make two instances with same value equal.

Returns:int

the hash code of the value stored in the ZipEightByteInteger

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override