com.distinct.rpc
Class XDRInputStream

java.lang.Object
  |
  +--com.distinct.rpc.XDRStream
        |
        +--com.distinct.rpc.XDRInputStream
Direct Known Subclasses:
XDRRecordInputStream

public class XDRInputStream
extends XDRStream

XDRInputStream implements an XDRStream that reads all encoded data from an InputStream. Use only the "decode" methods of this Stream. All encode operations will fail. Use an instance of XDROutputStream to write data to a Stream.

See Also:
XDROutputStream

Field Summary
 
Fields inherited from class com.distinct.rpc.XDRStream
alloc_size, buffer, in, out
 
Constructor Summary
XDRInputStream(java.io.InputStream inp)
          Creates a new XDRInputStream from a Java InputStream.
 
Method Summary
 byte get_byte()
          Reads one byte from the XDRInputStream.
 byte[] get_bytes(int n)
          Reads a number of bytes from the XDRInputStream.
 int get_length()
          Reports the number of bytes available in the XDRInputStream.
 void reset()
          Clears the XDRInputStream.
 void setTimeout(long time_in_ms)
          Obsolete since JDK 1.1.
 
Methods inherited from class com.distinct.rpc.XDRStream
dump, get_data, put_byte, put_bytes, xdr_decode_boolean, xdr_decode_char, xdr_decode_double, xdr_decode_float, xdr_decode_int, xdr_decode_long, xdr_decode_opaque, xdr_decode_opaque, xdr_decode_short, xdr_decode_string, xdr_decode_string, xdr_encode_boolean, xdr_encode_char, xdr_encode_double, xdr_encode_float, xdr_encode_int, xdr_encode_long, xdr_encode_opaque, xdr_encode_opaque, xdr_encode_short, xdr_encode_string, xdr_encode_string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XDRInputStream

public XDRInputStream(java.io.InputStream inp)
Creates a new XDRInputStream from a Java InputStream.

Parameters:
inp - The InputStream where all the encoded data is read from.
Method Detail

setTimeout

public void setTimeout(long time_in_ms)
Obsolete since JDK 1.1.


get_byte

public byte get_byte()
              throws RPCError
Reads one byte from the XDRInputStream. Used by the "decode" methods.

Overrides:
get_byte in class XDRStream
Returns:
Byte read.
Throws:
RPCError - When the call fails because of timeout, empty stream or other input error.

get_bytes

public byte[] get_bytes(int n)
                 throws RPCError
Reads a number of bytes from the XDRInputStream. Used by the "decode" methods.

Overrides:
get_bytes in class XDRStream
Parameters:
n - The number of bytes to be read.
Returns:
Bytes read.
Throws:
RPCError - When the call fails because of timeout, empty stream or other input error.

get_length

public int get_length()
Reports the number of bytes available in the XDRInputStream.

Overrides:
get_length in class XDRStream
Returns:
Number of bytes available.

reset

public void reset()
Clears the XDRInputStream.

Overrides:
reset in class XDRStream