public abstract class BufferImpl extends Object implements Serializable, Buffer
X_OCTET_Impl,
X_C_TYPE_Impl,
X_COMMON_Impl,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
BYTE_SIZE
The agreed size of a byte.
|
static int |
DOUBLE_SIZE
The agreed size of a double.
|
static int |
FLOAT_SIZE
The agreed size of a float.
|
static int |
INT_SIZE
The agreed size of a int.
|
protected int |
len |
static int |
LONG_SIZE
The agreed size of a long.
|
static int |
SHORT_SIZE
The agreed size of a short.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the content of the buffer
|
void |
deserialize(byte[] data)
Deserialize the buffer.
|
protected Object |
getAttributeValue(String key,
Class type)
Get the value of an attribute.
|
Map<String,Class> |
getFormat()
Get the format of the message.
|
int |
getLen() |
protected byte[] |
getRawData()
Get the raw data, used internally and by the X_OCTET buffer.
|
String |
getSubtype()
Get the subtype
|
String |
getType()
Get the type
|
byte[] |
serialize()
Serialize the buffer.
|
protected void |
setAttributeValue(String key,
Class type,
Object value)
Set the value.
|
protected void |
setRawData(byte[] bytes)
Set the raw data, used by the X_OCTET buffer.
|
public static final int BYTE_SIZE
public static final int LONG_SIZE
public static final int INT_SIZE
public static final int SHORT_SIZE
public static final int FLOAT_SIZE
public static final int DOUBLE_SIZE
protected int len
public Map<String,Class> getFormat()
public void deserialize(byte[] data)
throws ConnectionException
data - The data to deserialize.ConnectionException - In case the data does not match the format defined.public byte[] serialize()
throws ConnectionException
ConnectionException - In case the data cannot be formatted correctlypublic String getType()
public String getSubtype()
getSubtype in interface Bufferpublic void clear()
protected Object getAttributeValue(String key, Class type) throws ConnectionException
key - The keytype - The typeConnectionException - In case the message is not formatted yet.protected void setAttributeValue(String key, Class type, Object value) throws ConnectionException
key - The key to settype - The type of the value.value - The value to useConnectionException - In case the message is not formatted.protected void setRawData(byte[] bytes)
bytes - The data to use.protected byte[] getRawData()
Copyright © 2015 JBoss by Red Hat. All Rights Reserved.