|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.rpc.Xdr
This class handles the marshalling/unmarshalling of primitive data types into and out of a buffer. The XDR buffer is a field within this class and its size is determined when the class is instantiated. Other than this buffer, there are just two pointers: "off" is the current XDR offset into the buffer and moves up the buffer by an integral number of XDRUNITs as data are encoded/decoded. The other pointer is "size" which is the number of valid data bytes in the buffer and is set only for received buffers. XXX we should perhaps check that off <= size whenever an item is decoded so that we can raise an exception if the received data is underlength.
Rpc
Constructor Summary | |
Xdr(int size)
Build a new Xdr object with a buffer of given size |
Method Summary | |
boolean |
xdr_bool()
Get a boolean from the buffer |
void |
xdr_bool(boolean b)
Put a boolean into the buffer |
byte[] |
xdr_buf()
Return the entire Xdr buffer |
byte[] |
xdr_bytes()
Get a counted array of bytes from the buffer |
void |
xdr_bytes(byte[] b)
Put a counted array of bytes into the buffer. |
void |
xdr_bytes(byte[] b,
int len)
Put a counted array of bytes into the buffer |
void |
xdr_bytes(byte[] b,
int boff,
int len)
Put a counted array of bytes into the buffer |
void |
xdr_bytes(Xdr x)
Put an Xdr buffer into the buffer This is used to encode the RPC credentials |
float |
xdr_float()
Get a floating point number from the buffer |
void |
xdr_float(float f)
Put a floating point number into the buffer |
long |
xdr_hyper()
Get a long from the buffer |
void |
xdr_hyper(long i)
Put a long into the buffer |
int |
xdr_int()
Get an integer from the buffer |
void |
xdr_int(int i)
Put an integer into the buffer |
int |
xdr_offset()
Return the current offset |
void |
xdr_offset(int off)
Set the current offset |
void |
xdr_raw(byte[] b)
Put a fixed number of bytes into the buffer The length is not encoded. |
void |
xdr_raw(byte[] b,
int off)
Put a fixed number of bytes into the buffer at offset off. |
void |
xdr_raw(byte[] b,
int boff,
int len)
Put a counted array of bytes into the buffer. |
byte[] |
xdr_raw(int len)
Get a fixed number of bytes from the buffer e.g. |
byte[] |
xdr_raw(int off,
int len)
Get a fixed number (len) of bytes from the buffer at offset off. |
int |
xdr_size()
Return the current size of the XDR buffer |
void |
xdr_size(int size)
Set the current size of the XDR buffer |
void |
xdr_skip(int count)
Skip a number of bytes. |
java.lang.String |
xdr_string()
Get a string from the buffer |
void |
xdr_string(java.lang.String s)
Put a string into the buffer |
long |
xdr_u_int()
Get an unsigned integer from the buffer Note that Java has no unsigned integer type so we must return it as a long. |
void |
xdr_u_int(long i)
Put an unsigned integer into the buffer Note that Java has no unsigned integer type so we must submit it as a long. |
int |
xdr_wrap_offset()
Return the starting point of the bytes that will be encrypted. |
void |
xdr_wrap_offset(int off)
Set the starting point of the bytes that will be encrypted. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Xdr(int size)
size
- of the buffer in bytesMethod Detail |
public void xdr_skip(int count)
count
- of the buffer in bytespublic byte[] xdr_buf()
public int xdr_offset()
public void xdr_offset(int off)
off
- offset into XDR bufferpublic int xdr_wrap_offset()
public void xdr_wrap_offset(int off)
public int xdr_size()
public void xdr_size(int size)
size
- of bufferpublic int xdr_int()
public void xdr_int(int i)
i
- Integer to store in XDR buffer.public long xdr_u_int()
public void xdr_u_int(long i)
i
- unsigned integer to store in XDR buffer.public long xdr_hyper()
public void xdr_hyper(long i)
i
- long to store in XDR bufferpublic boolean xdr_bool()
public void xdr_bool(boolean b)
b
- booleanpublic float xdr_float()
public void xdr_float(float f)
f
- floatpublic java.lang.String xdr_string()
public void xdr_string(java.lang.String s)
s
- stringpublic byte[] xdr_bytes()
public void xdr_bytes(byte[] b)
b
- byte arraypublic void xdr_bytes(byte[] b, int len)
b
- byte arraylen
- number of bytes to encodepublic void xdr_bytes(byte[] b, int boff, int len)
b
- byte arrayboff
- offset into byte arraylen
- number of bytes to encodepublic void xdr_bytes(Xdr x)
x
- XDR bufferpublic byte[] xdr_raw(int len)
len
- Number of bytes to getpublic byte[] xdr_raw(int off, int len)
off
- Offset of bytes to get fromlen
- Number of bytes to copypublic void xdr_raw(byte[] b)
b
- byte arraypublic void xdr_raw(byte[] b, int off)
b
- byte arrayoff
- where to put the byte arraypublic void xdr_raw(byte[] b, int boff, int len)
b
- byte arrayboff
- offset into byte arraylen
- number of bytes to encode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |