public class NameUtil extends Object
Constructor and Description |
---|
NameUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
idnEquals(String name1,
String name2)
Check if two internationalized domain names are equal, possibly causing
a serialization of both domain names.
|
static String |
parse(byte[] data,
int offset,
HashSet<Integer> jumps)
Parse a domain name starting at the given offset.
|
static String |
parse(DataInputStream dis,
byte[] data)
Parse a domain name starting at the current offset and moving the input
stream pointer past this domain name (even if cross references occure).
|
static int |
size(String name)
Retrieve the rough binary length of a string
(length + 2 bytes length prefix).
|
static byte[] |
toByteArray(String name)
Serialize a domain name under IDN rules.
|
public static int size(String name)
name
- The name string.public static boolean idnEquals(String name1, String name2)
name1
- The first domain name.name2
- The second domain name.public static byte[] toByteArray(String name) throws IOException
name
- The domain name.IOException
- Should never happen.public static String parse(DataInputStream dis, byte[] data) throws IOException
dis
- The input stream.data
- The raw data (for cross references).IOException
- Should never happen.public static String parse(byte[] data, int offset, HashSet<Integer> jumps)
data
- The raw data.offset
- The offset.jumps
- The list of jumps (by now).IllegalStateException
- on cycles.Copyright © 2014–2019. All rights reserved.