public abstract class XdrSimple<T> extends AbstractXdrType<T>
| Constructor and Description |
|---|
XdrSimple(XdrDataType dataTypeNo)
Default constructor, generally for decoding as a value container
|
XdrSimple(XdrDataType xdrDataType,
T value)
Constructor with a value, generally for encoding of the value
|
| Modifier and Type | Method and Description |
|---|---|
void |
decode(ByteBuffer content)
Decode the content bytes into this type.
|
protected void |
decodeBody(ByteBuffer body) |
protected byte[] |
encodeBody() |
protected void |
encodeBody(ByteBuffer buffer)
Put encoded bytes into buffer.
|
protected int |
encodingBodyLength()
Length including null bytes to maintain an multiple of 4.
|
protected byte[] |
getBytes() |
static boolean |
isSimple(XdrDataType dataType) |
protected void |
setBytes(byte[] bytes) |
protected abstract void |
toBytes()
Encode simple type to bytes.
|
protected abstract void |
toValue()
Decode bytes to simple value.
|
decode, encode, encode, encodingLength, getDataType, getValue, setValuepublic XdrSimple(XdrDataType dataTypeNo)
dataTypeNo - The dataType numberpublic XdrSimple(XdrDataType xdrDataType, T value)
xdrDataType - The dataType numbervalue - The valueprotected byte[] getBytes()
protected void setBytes(byte[] bytes)
protected byte[] encodeBody()
throws IOException
IOExceptionprotected void encodeBody(ByteBuffer buffer) throws IOException
encodeBody in class AbstractXdrType<T>buffer - ByteBuffer to hold encoded bytes.IOExceptionprotected int encodingBodyLength()
throws IOException
encodingBodyLength in class AbstractXdrType<T>IOExceptionpublic void decode(ByteBuffer content) throws IOException
XdrTypedecode in interface XdrTypedecode in class AbstractXdrType<T>content - The content bytesIOException - eprotected void decodeBody(ByteBuffer body) throws IOException
IOExceptionprotected abstract void toValue()
throws IOException
IOExceptionprotected abstract void toBytes()
throws IOException
IOException - epublic static boolean isSimple(XdrDataType dataType)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.