Package net.handle.dnslib
Class DomainName
java.lang.Object
net.handle.dnslib.DomainName
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionancestorChildOf
(DomainName name) Assumes name is already an ancestor of this; returns the child of name that is also an ancestor of thisint
appendToWireWithCompression
(OutputStream wire, int offset, Map<DomainName, Integer> compressionTable) int
appendToWireWithCompression
(OutputStream wire, int offset, Map<DomainName, Integer> compressionTable, boolean compress) static final byte
decodeHexByte
(byte ch1, byte ch2) boolean
descendsFrom
(DomainName ancestor) boolean
byte[][]
Return a byte array of labelsint
hashCode()
static final boolean
isHexByte
(byte ch1, byte ch2) int
length()
static DomainName
Parses an UTF8 string as would appear in a IDN-capable master file; it does NOT create hx-- labelsparent()
static DomainName
parseWire
(byte[] wire, int[] offsetArr) Returns a DomainName and changes the offset stored in offsetArr[0]byte[]
Converts to handle, using IDNA (xn--), as well as hx-- encoding (which is like percent encoding only it uses hyphen).toString()
Returns an ASCII string as would appear in a master file.
-
Field Details
-
HEX_ENCODING_PREFIX
- See Also:
-
ROOT
-
-
Constructor Details
-
DomainName
public DomainName(byte[][] labels)
-
-
Method Details
-
getLabels
public byte[][] getLabels()Return a byte array of labels -
toString
Returns an ASCII string as would appear in a master file. -
ofString
Parses an UTF8 string as would appear in a IDN-capable master file; it does NOT create hx-- labels- Throws:
ParseException
-
isHexByte
public static final boolean isHexByte(byte ch1, byte ch2) -
decodeHexByte
public static final byte decodeHexByte(byte ch1, byte ch2) -
toHandle
Converts to handle, using IDNA (xn--), as well as hx-- encoding (which is like percent encoding only it uses hyphen). Order is reversed and '/' is used as separator in place of '.'- Throws:
ParseException
-
parent
-
ancestorChildOf
Assumes name is already an ancestor of this; returns the child of name that is also an ancestor of this -
descendsFrom
-
asteriskLabelSibling
-
length
public int length() -
parseWire
Returns a DomainName and changes the offset stored in offsetArr[0]- Throws:
ParseException
-
appendToWireWithCompression
public int appendToWireWithCompression(OutputStream wire, int offset, Map<DomainName, Integer> compressionTable) throws IOException- Throws:
IOException
-
appendToWireWithCompression
public int appendToWireWithCompression(OutputStream wire, int offset, Map<DomainName, Integer> compressionTable, boolean compress) throws IOException- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-