com.distinct.rpc
Class XDROutputStream

java.lang.Object
  |
  +--com.distinct.rpc.XDRStream
        |
        +--com.distinct.rpc.XDROutputStream
Direct Known Subclasses:
XDRRecordOutputStream

public class XDROutputStream
extends XDRStream

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

See Also:
XDROutputStream

Field Summary
 
Fields inherited from class com.distinct.rpc.XDRStream
alloc_size, buffer, in, out
 
Constructor Summary
XDROutputStream(java.io.OutputStream outp)
          Creates a new XDROutputStream from a Java OutputStream.
 
Method Summary
 int get_length()
          Reports the number of bytes written to the XDROutputStream.
 void put_byte(byte b)
          Writes one byte to the XDROutputStream.
 void put_bytes(byte[] b, int n)
          Writes a number of bytes to the XDROutputStream.
 void reset()
          Just resets the written byte counter.
 
Methods inherited from class com.distinct.rpc.XDRStream
dump, get_byte, get_bytes, get_data, 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

XDROutputStream

public XDROutputStream(java.io.OutputStream outp)
Creates a new XDROutputStream from a Java OutputStream.

Parameters:
outp - The OutputStream where all the encoded data is written to.
Method Detail

put_byte

public void put_byte(byte b)
Writes one byte to the XDROutputStream. Used by the "encode" methods.

Overrides:
put_byte in class XDRStream
Parameters:
b - The byte to be written.

put_bytes

public void put_bytes(byte[] b,
                      int n)
Writes a number of bytes to the XDROutputStream. Used by the "encode" methods.

Overrides:
put_bytes in class XDRStream
Parameters:
b - The bytes to be written (starting from index 0).
n - The number of bytes to be written.

get_length

public int get_length()
Reports the number of bytes written to the XDROutputStream.

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

reset

public void reset()
Just resets the written byte counter.

Overrides:
reset in class XDRStream