public class Xdr
extends java.lang.Object
Rpc
Constructor and Description |
---|
Xdr(int size)
Build a new Xdr object with a buffer of given size
|
Modifier and Type | Method and Description |
---|---|
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.
|
public Xdr(int size)
size
- of the buffer in bytespublic 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