public final class XDR
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
XDR.State |
| Constructor | Description |
|---|---|
XDR() |
|
XDR(byte[] src) |
Wraps a byte array as a read-only XDR message.
|
XDR(int initialCapacity) |
Construct a new XDR message buffer.
|
XDR(java.nio.ByteBuffer buf,
XDR.State state) |
| Modifier and Type | Method | Description |
|---|---|---|
XDR |
asReadOnlyWrap() |
|
java.nio.ByteBuffer |
buffer() |
|
static int |
fragmentSize(byte[] mark) |
|
byte[] |
getBytes() |
|
static boolean |
isLastFragment(byte[] mark) |
|
boolean |
readBoolean() |
|
byte[] |
readFixedOpaque(int size) |
|
long |
readHyper() |
|
int |
readInt() |
|
java.lang.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 io.netty.buffer.ByteBuf |
writeMessageTcp(XDR request,
boolean last) |
Write an XDR message to a TCP ChannelBuffer.
|
static io.netty.buffer.ByteBuf |
writeMessageUdp(XDR response) |
Write an XDR message to a UDP ChannelBuffer.
|
void |
writeString(java.lang.String s) |
|
void |
writeVariableOpaque(byte[] src) |
public XDR(int initialCapacity)
initialCapacity - the initial capacity of the buffer.public XDR()
public XDR(java.nio.ByteBuffer buf,
XDR.State state)
public XDR(byte[] src)
src - the byte array to be wrapped.public XDR asReadOnlyWrap()
public java.nio.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 java.lang.String readString()
public void writeString(java.lang.String s)
public static boolean verifyLength(XDR xdr, int len)
xdr - XDR messagelen - minimum remaining lengthpublic static io.netty.buffer.ByteBuf writeMessageTcp(XDR request, boolean last)
request - XDR requestlast - specifies last request or notpublic static io.netty.buffer.ByteBuf writeMessageUdp(XDR response)
response - XDR responsepublic static int fragmentSize(byte[] mark)
public static boolean isLastFragment(byte[] mark)
@VisibleForTesting public byte[] getBytes()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.