Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
javax.naming

Class BinaryRefAddr

java.lang.Object
|
+--javax.naming.RefAddr
   |
   +--javax.naming.BinaryRefAddr


public class BinaryRefAddr

extends RefAddr

RefAddr that uses a byte array as content. This can be used to reference objects that can only be represented as byte arrays.

Since:Author:See Also:

Constructor Summary

BinaryRefAddr(java.lang.String addrType, byte[] buf)

Contructs a new BinaryRefAddr with the given type and content.
BinaryRefAddr(java.lang.String addrType, byte[] buf, int off, int length)

Contructs a new BinaryRefAddr with the given type and the content taken from the given byte array.

Method Summary

booleanequals(java.lang.Object o)

Checks if the object is a BinaryRefAddr with the same type and with the same bytes in the content.
java.lang.ObjectgetContent()

Returns the byte array contents as given to the constructor.
inthashCode()

Returns the hashCode which is the hasCode of the String returned by getType() plus the hashCode of the byte array returned by getContent.
java.lang.StringtoString()

Returns a String representation of the RefAddr.

Constructor Details

BinaryRefAddr

public BinaryRefAddr(java.lang.String addrType, byte[] buf)

Contructs a new BinaryRefAddr with the given type and content. The complete content of the byte array is copied to a new array.

Parameters:


BinaryRefAddr

public BinaryRefAddr(java.lang.String addrType, byte[] buf, int off, int length)

Contructs a new BinaryRefAddr with the given type and the content taken from the given byte array. The content of the byte array is copied to a new array.

Parameters:


Method Details

equals

public boolean equals(java.lang.Object o)

Checks if the object is a BinaryRefAddr with the same type and with the same bytes in the content.

Parameters:

Returns:


getContent

public Object getContent()

Returns the byte array contents as given to the constructor. The returned byte array is shared with this object and other callers. Changing the content of the buffer is discouraged and should only be done when the byte array is locked.


hashCode

public int hashCode()

Returns the hashCode which is the hasCode of the String returned by getType() plus the hashCode of the byte array returned by getContent. The hashCode of the byte array is calculated by taking the xor of all the bytes in the array, or zero when there are no bytes in the array.


toString

public String toString()

Returns a String representation of the RefAddr. Only the first 32 bytes of the content are added as hex encoded characters. Should only be used for debugging purposes.