APIdia Launch Partner
Top Description Constructors Methods
sun.security.util

public Class ByteArrayTagOrder

extends Object
implements Comparator<byte[]>
Class Inheritance
All Implemented Interfaces
java.util.Comparator
Imports
java.util.Comparator

ByteArrayTagOrder: a class for comparing two DER encodings by the order of their tags.
Author
D. N. Hoover

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final int

Returns:

negative number if bytes1 < bytes2, 0 if bytes1 == bytes2, positive number if bytes1 > bytes2.
compare
(byte[]
first byte array to compare.
bytes1
,
byte[]
second byte array to compare.
bytes2
)

Implements java.util.Comparator.compare.

Compare two byte arrays, by the order of their tags, as defined in ITU-T X.680, sec. 6.4.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ByteArrayTagOrderback to summary
public ByteArrayTagOrder()

Method Detail

compareback to summary
public final int compare(byte[] bytes1, byte[] bytes2)

Implements java.util.Comparator.compare.

Compare two byte arrays, by the order of their tags, as defined in ITU-T X.680, sec. 6.4. (First compare tag classes, then tag numbers, ignoring the constructivity bit.)

Parameters
bytes1:byte[]

first byte array to compare.

bytes2:byte[]

second byte array to compare.

Returns:int

negative number if bytes1 < bytes2, 0 if bytes1 == bytes2, positive number if bytes1 > bytes2.

Exceptions
ClassCastException:
if either argument is not a byte array.