T - the type of the value encoded/decoded or wrapped by thispublic abstract class AbstractXdrType<T> extends Object implements XdrType
| Constructor and Description |
|---|
AbstractXdrType(XdrDataType dataType)
Default constructor.
|
AbstractXdrType(XdrDataType dataType,
T value)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decode(byte[] content)
Decode the content bytes into this type.
|
void |
decode(ByteBuffer content)
Decode the content bytes into this type.
|
byte[] |
encode()
Encode the type, by recursively.
|
void |
encode(ByteBuffer buffer)
Encode the type, by recursively, using the provided buffer.
|
protected abstract void |
encodeBody(ByteBuffer buffer) |
protected abstract int |
encodingBodyLength() |
int |
encodingLength()
Get length of encoding bytes by just calculating without real encoding.
|
XdrDataType |
getDataType() |
T |
getValue() |
void |
setValue(T value) |
public AbstractXdrType(XdrDataType dataType, T value)
dataType - the dataTypevalue - the valuepublic AbstractXdrType(XdrDataType dataType)
dataType - the dataTypepublic byte[] encode()
throws IOException
XdrTypeencode in interface XdrTypeIOException - epublic void encode(ByteBuffer buffer) throws IOException
XdrTypeencode in interface XdrTypebuffer - The byte bufferIOException - eprotected abstract void encodeBody(ByteBuffer buffer) throws IOException
IOExceptionpublic void decode(byte[] content)
throws IOException
XdrTypedecode in interface XdrTypecontent - The content bytesIOException - epublic int encodingLength()
throws IOException
XdrTypeencodingLength in interface XdrTypeIOException - eprotected abstract int encodingBodyLength()
throws IOException
IOExceptionpublic void decode(ByteBuffer content) throws IOException
XdrTypedecode in interface XdrTypecontent - The content bytesIOException - epublic T getValue()
public void setValue(T value)
public XdrDataType getDataType()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.