DNS A record payload representing an IPv4 address.
Maps a domain name to an IPv4 address, the most common DNS record type.
Maps a domain name to an IPv4 address, the most common DNS record type.
Field Summary
Fields inherited from class InternetAddressRR
ipConstructor Summary
ConstructorsConstructorDescriptionA(byte[] ip) Create A record from byte array.A(int q1, int q2, int q3, int q4) Create A record from four octets.A(CharSequence ipv4CharSequence) Create A record from character sequence.A(Inet4Address inet4Address) Create A record from IPv4 address.Method Summary
Modifier and TypeMethodDescriptiongetType()The payload type.static Aparse(DataInputStream dis) Parse A record from data input stream.toString()Methods inherited from class InternetAddressRR
from, getInetAddress, getIp, serializeModifier and TypeMethodDescriptionstatic InternetAddressRR<? extends InetAddress> from(InetAddress inetAddress) Create an InternetAddressRR from an InetAddress.final Inet4AddressGet the InetAddress for this record.final byte[]getIp()Allocates a new byte buffer and fills the buffer with the bytes representing the IP address of this resource record.final voidWrites the raw address bytes to the stream.Methods inherited from class Data
equals, hashCode, length, toByteArray, toOutputStream, toOutputStreamModifier and TypeMethodDescriptionfinal booleanfinal inthashCode()final intlength()Serialize this record, if that has not been done already, and report the resulting wire size.final byte[]Serialize this record, if that has not been done already, and return a copy of the result so callers cannot mutate the cached bytes.final voidWrite the binary representation of this payload to the givenDataOutputStream.final voidtoOutputStream(OutputStream outputStream) Write the binary representation to the given OutputStream.
Constructor Details
A
Create A record from IPv4 address.- Parameters:
inet4Address- the IPv4 address
A
public A(int q1, int q2, int q3, int q4) Create A record from four octets.- Parameters:
q1- the most significant octet, 0-255; another value throwsq2- the next octet, 0-255; another value throwsq3- the next octet, 0-255; another value throwsq4- the least significant octet, 0-255; another value throws
A
public A(byte[] ip) Create A record from byte array.- Parameters:
ip- byte array containing IPv4 address (must be 4 bytes)
A
Create A record from character sequence.- Parameters:
ipv4CharSequence- character sequence containing IPv4 address
Method Details
getType
Description copied from class:DataThe payload type.parse
Parse A record from data input stream.- Parameters:
dis- data input stream to read from- Returns:
- parsed A record
- Throws:
IOException- if I/O error occurs
toString