public final class XDR extends Object
Modifier and Type | Class and Description |
---|---|
static class |
XDR.State |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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) |
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.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()
Copyright © 2013 Apache Software Foundation. All rights reserved.