|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.ByteArrayInputStream
org.opennms.protocols.dns.DNSInputStream
DNSInputStrean extends a ByteArrayInputStream and has methods to decode the data of a DNS response to an address resquest.
Field Summary |
Fields inherited from class java.io.ByteArrayInputStream |
buf, count, mark, pos |
Fields inherited from class java.io.InputStream |
|
Constructor Summary | |
DNSInputStream(byte[] data)
Constructs a new input stream for decoding DNS records. |
|
DNSInputStream(byte[] data,
int off,
int len)
Constructs a DNSInputStream object from the byte array. |
Method Summary | |
int |
readByte()
Read a byte off the input stream. |
java.lang.String |
readDomainName()
The readDomainName method is used to read an entire domain name from the stream. |
long |
readInt()
Read an 'int' off the input stream. |
DNSAddressRR |
readRR()
Reads the resource record from the input stream. |
int |
readShort()
Read a 'short' off the input stream. |
java.lang.String |
readString()
Read a 'string' off the input stream. |
Methods inherited from class java.io.ByteArrayInputStream |
available, close, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.io.InputStream |
read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DNSInputStream(byte[] data)
Constructs a new input stream for decoding DNS records.
data
- The array of data to pass to the base class.public DNSInputStream(byte[] data, int off, int len)
Constructs a DNSInputStream object from the byte array.
data
- byte array containing the response dataoff
- offset of the data in the byte arraylen
- length of the byte arrayMethod Detail |
public int readByte() throws java.io.IOException
Read a byte off the input stream.
java.io.IOException
- Thrown if the end-of-file is encountered trying to read
the next byte.public int readShort() throws java.io.IOException
Read a 'short' off the input stream.
java.io.IOException
- Thrown if the end-of-file is encountered trying to read
the next short.public long readInt() throws java.io.IOException
Read an 'int' off the input stream.
java.io.IOException
- Thrown if there is an error while read.public java.lang.String readString() throws java.io.IOException
Read a 'string' off the input stream.
java.io.IOException
- Thrown if there is an error while readpublic java.lang.String readDomainName() throws java.io.IOException
The readDomainName method is used to read an entire domain name from the stream. The string returned will be the concatentation of several substrings, each substring in the record is separated by a '.'(dot). For more information see the RFC for the distributed name service.
java.io.IOException
- Thrown if an error occurs decoding the string from the
stream.public DNSAddressRR readRR() throws java.io.IOException
Reads the resource record from the input stream.
java.io.IOException
- Thrown if data does not decode to a DNSAddressRRl.
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |