Secure iNet Factory

com.jscape.inet.dns
Class DnsInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.ByteArrayInputStream
          extended by com.jscape.inet.dns.DnsInputStream
All Implemented Interfaces:
java.io.Closeable

public class DnsInputStream
extends java.io.ByteArrayInputStream

InputStream responsible for parsing byte[] data retrieved in communcations with a Dns server.


Constructor Summary
DnsInputStream(byte[] data, int off, int len)
          Constructs a new DnsInputStream instance.
 
Method Summary
 int readByte()
          Reads the next byte of data from this input stream.
 java.lang.String readDomainName()
          Parses out domain name from response.
 long readInt()
          Reads four input bytes and returns an int value.
 DnsRecord readRecord()
          Reads a DnsRecord from response.
 int readShort()
          Reads two input bytes and returns a unsigned short value.
 java.lang.String readString()
          Reads String from response.
 
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DnsInputStream

public DnsInputStream(byte[] data,
                      int off,
                      int len)
Constructs a new DnsInputStream instance.

Parameters:
data - the input buffer
off - the offset in the buffer of the first byte to read.
len - the maximum number of bytes to read from the buffer.
Method Detail

readByte

public int readByte()
             throws java.io.IOException
Reads the next byte of data from this input stream.

Returns:
the 8-bit value read.
Throws:
java.io.IOException - if an I/O error occurs

readShort

public int readShort()
              throws java.io.IOException
Reads two input bytes and returns a unsigned short value.

Returns:
the 16-bit value read.
Throws:
java.io.IOException - if an I/O error occurs

readInt

public long readInt()
             throws java.io.IOException
Reads four input bytes and returns an int value.

Returns:
the int value read.
Throws:
java.io.IOException - if an I/O error occurs

readString

public java.lang.String readString()
                            throws java.io.IOException
Reads String from response.

Returns:
the String read.
Throws:
java.io.IOException - if an I/O error occurs

readDomainName

public java.lang.String readDomainName()
                                throws java.io.IOException
Parses out domain name from response.

Returns:
domain name
Throws:
java.io.IOException - if an I/O error occurs

readRecord

public DnsRecord readRecord()
                     throws java.io.IOException
Reads a DnsRecord from response.

Returns:
the DnsRecord read.
Throws:
java.io.IOException - if an I/O error occurs
See Also:
DnsRecord

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved