|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.oncrpc.XDR
public final class XDR
Utility class for building XDR messages based on RFC 4506. Key points of the format:
| Nested Class Summary | |
|---|---|
static class |
XDR.State
|
| Constructor Summary | |
|---|---|
XDR()
|
|
XDR(byte[] src)
Wraps a byte array as a read-only XDR message. |
|
XDR(ByteBuffer buf,
XDR.State state)
|
|
XDR(int initialCapacity)
Construct a new XDR message buffer. |
|
| Method Summary | |
|---|---|
XDR |
asReadOnlyWrap()
|
ByteBuffer |
buffer()
|
static int |
fragmentSize(byte[] mark)
|
byte[] |
getBytes()
|
static boolean |
isLastFragment(byte[] mark)
|
boolean |
readBoolean()
|
byte[] |
readFixedOpaque(int size)
|
long |
readHyper()
|
int |
readInt()
|
String |
readString()
|
byte[] |
readVariableOpaque()
|
int |
size()
|
static boolean |
verifyLength(XDR xdr,
int len)
check if the rest of data has more than len bytes |
void |
writeBoolean(boolean v)
|
void |
writeFixedOpaque(byte[] src)
|
void |
writeFixedOpaque(byte[] src,
int length)
|
void |
writeInt(int v)
|
void |
writeLongAsHyper(long v)
|
static org.jboss.netty.buffer.ChannelBuffer |
writeMessageTcp(XDR request,
boolean last)
Write an XDR message to a TCP ChannelBuffer |
static org.jboss.netty.buffer.ChannelBuffer |
writeMessageUdp(XDR response)
Write an XDR message to a UDP ChannelBuffer |
void |
writeString(String s)
|
void |
writeVariableOpaque(byte[] src)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XDR(int initialCapacity)
initialCapacity - the initial capacity of the buffer.public XDR()
public XDR(ByteBuffer buf,
XDR.State state)
public XDR(byte[] src)
src - the byte array to be wrapped.| Method Detail |
|---|
public XDR asReadOnlyWrap()
public ByteBuffer buffer()
public int size()
public int readInt()
public void writeInt(int v)
public boolean readBoolean()
public void writeBoolean(boolean v)
public long readHyper()
public void writeLongAsHyper(long v)
public byte[] readFixedOpaque(int size)
public void writeFixedOpaque(byte[] src,
int length)
public void writeFixedOpaque(byte[] src)
public byte[] readVariableOpaque()
public void writeVariableOpaque(byte[] src)
public String readString()
public void writeString(String s)
public static boolean verifyLength(XDR xdr,
int len)
public static org.jboss.netty.buffer.ChannelBuffer writeMessageTcp(XDR request,
boolean last)
public static org.jboss.netty.buffer.ChannelBuffer writeMessageUdp(XDR response)
public static int fragmentSize(byte[] mark)
public static boolean isLastFragment(byte[] mark)
public byte[] getBytes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||