edu.berkeley.psi.tagged.api
Class Opaque

java.lang.Object
  extended by edu.berkeley.psi.tagged.api.Tagged
      extended by edu.berkeley.psi.tagged.api.Opaque
All Implemented Interfaces:
TaggedIF, XdrAble

public class Opaque
extends Tagged

A Tagged wrapper around an opaque (uninterpreted) byte[] array. The Opaque(byte[]) constructor shares the byte[] buffer with the caller, while the Opaque(byte[],int,int) constructor makes a copy of the data.


Field Summary
protected  byte[] data
          The wrapped byte[] array
 
Fields inherited from class edu.berkeley.psi.tagged.api.Tagged
classes, initLock
 
Constructor Summary
Opaque(byte[] data)
          Construct an Opaque byte[] wrapper that shares the data buffer
Opaque(byte[] buf, int offset, int len)
          Construct an Opaque byte[] wrapper that copies the data
 
Method Summary
 byte[] getBytes()
          Return the wrapped byte[] data
(package private) static Opaque newInstance()
          Create an unintialized Opaque object for xdrDecode()
static int staticTag()
          The class tag used for XdrDecode disambiguation.
 void xdrDecode(XdrDecodingStream xdr)
          Deserialize an opaque byte[] buffer from a stream
 void xdrEncode(XdrEncodingStream xdr)
          Serialize an opaque byte[] buffer to a XdrEncodingStream
 
Methods inherited from class edu.berkeley.psi.tagged.api.Tagged
addClass, addClass, digest, digest, digestWith, get, getBody, getTag, newInstance, put, put, putBody, putTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected byte[] data
The wrapped byte[] array

Constructor Detail

Opaque

public Opaque(byte[] data)
Construct an Opaque byte[] wrapper that shares the data buffer


Opaque

public Opaque(byte[] buf,
              int offset,
              int len)
Construct an Opaque byte[] wrapper that copies the data

Method Detail

getBytes

public byte[] getBytes()
Return the wrapped byte[] data


staticTag

public static int staticTag()
The class tag used for XdrDecode disambiguation.


xdrDecode

public void xdrDecode(XdrDecodingStream xdr)
               throws OncRpcException,
                      java.io.IOException
Deserialize an opaque byte[] buffer from a stream

Parameters:
xdr - XDR stream from which decoded information is retrieved.
Throws:
OncRpcException - if an ONC/RPC error occurs.
java.io.IOException - if an I/O error occurs.

xdrEncode

public void xdrEncode(XdrEncodingStream xdr)
               throws OncRpcException,
                      java.io.IOException
Serialize an opaque byte[] buffer to a XdrEncodingStream

Parameters:
xdr - XDR stream to which information is sent for encoding.
Throws:
OncRpcException - if an ONC/RPC error occurs.
java.io.IOException - if an I/O error occurs.

newInstance

static Opaque newInstance()
Create an unintialized Opaque object for xdrDecode()