|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xbill.DNS.DNSInput
public class DNSInput
An class for parsing DNS messages.
| Constructor Summary | |
|---|---|
DNSInput(byte[] input)
Creates a new DNSInput |
|
| Method Summary | |
|---|---|
void |
clearActive()
Clears the active region of the string. |
int |
current()
Returns the current position. |
void |
jump(int index)
Resets the current position of the input stream to the specified index, and clears the active region. |
byte[] |
readByteArray()
Reads a byte array consisting of the remainder of the stream (or the active region, if one is set. |
void |
readByteArray(byte[] b,
int off,
int len)
Reads a byte array of a specified length from the stream into an existing array. |
byte[] |
readByteArray(int len)
Reads a byte array of a specified length from the stream. |
byte[] |
readCountedString()
Reads a counted string from the stream. |
int |
readU16()
Reads an unsigned 16 bit value from the stream, as an int. |
long |
readU32()
Reads an unsigned 32 bit value from the stream, as a long. |
int |
readU8()
Reads an unsigned 8 bit value from the stream, as an int. |
int |
remaining()
Returns the number of bytes that can be read from this stream before reaching the end. |
void |
restore()
Restores the input stream to its state before the call to save(). |
void |
save()
Saves the current state of the input stream. |
void |
setActive(int len)
Marks the following bytes in the stream as active. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DNSInput(byte[] input)
input - The byte array to read from| Method Detail |
|---|
public int current()
public int remaining()
public void setActive(int len)
len - The number of bytes in the active region.
IllegalArgumentException - The number of bytes in the active region
is longer than the remainder of the input.public void clearActive()
public void jump(int index)
index - The position to continue parsing at.
IllegalArgumentException - The index is not within the input.public void save()
IllegalArgumentException - The index is not within the input.public void restore()
save().
public int readU8()
throws WireParseException
WireParseException - The end of the stream was reached.
public int readU16()
throws WireParseException
WireParseException - The end of the stream was reached.
public long readU32()
throws WireParseException
WireParseException - The end of the stream was reached.
public void readByteArray(byte[] b,
int off,
int len)
throws WireParseException
b - The array to read into.off - The offset of the array to start copying data into.len - The number of bytes to copy.
WireParseException - The end of the stream was reached.
public byte[] readByteArray(int len)
throws WireParseException
WireParseException - The end of the stream was reached.public byte[] readByteArray()
public byte[] readCountedString()
throws WireParseException
WireParseException - The end of the stream was reached.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||