|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The IMarshall interface provides a structure for creating other marshalled objects. It
provides standard error values, standard marshalled byte types, and standard data sizes.
It also provides a binaryEncode()
and a binaryDecode()
method, which
give users access to marshalled and unmarshalled data implemented by instances of this interface.
The mashalled and unmarshalled data should contained within the implementing object. Accessors to this data are left to user discretion.
public class MarshalledObject implements IMarshall { private Object data = null; public int binaryEncode(ObjectRef buffer, ObjectRef rPos) { // Take the values stored in data // Encode them // Pass the values back to buffer } public int binaryDecode(ObjectRef buffer, ObjectRef rPos) { // Take the value from buffer // Decode it // Store the values in data } public Object getData() { return data; } }
Field Summary | |
static byte |
SIZE_CHAR
|
static byte |
SIZE_DWORD
|
static byte |
SIZE_QWORD
|
static byte |
SIZE_WORD
|
static int |
STV_DECODE_DATA_INCOMPLETE
|
static int |
STV_DECODE_DATA_TOO_SMALL
|
static int |
STV_DECODE_EOS
|
static int |
STV_DECODE_OBJECT_TOO_SMALL
|
static int |
STV_DECODE_OK
|
static int |
STV_DECODE_VARIABLE_MISMATCH
|
static int |
STV_ENCODE_BUFFER_TOO_SMALL
|
static int |
STV_ENCODE_OK
|
static int |
STV_ENCODE_VARIABLE_UNKNOWN
|
static byte |
TYPE_ARRAY
|
static byte |
TYPE_CHAR
|
static byte |
TYPE_CHAR_ARRAY
|
static byte |
TYPE_DWORD
|
static byte |
TYPE_DWORD_ARRAY
|
static byte |
TYPE_LONG_CHAR_ARRAY
|
static byte |
TYPE_QWORD
|
static byte |
TYPE_QWORD_ARRAY
|
static byte |
TYPE_SKIP
|
static byte |
TYPE_STRUCT_END
|
static byte |
TYPE_STRUCT_START
|
static byte |
TYPE_WORD
|
static byte |
TYPE_WORD_ARRAY
|
Method Summary | |
int |
binaryDecode(ObjectRef buffer,
ObjectRef rPos)
The binaryDecode function decodes binary data passed in and places it into an internal set of values. |
int |
binaryEncode(ObjectRef buffer,
ObjectRef rPos)
The binaryEncode function encodes the internal set of values and places them in a single binary value. |
Field Detail |
public static final int STV_DECODE_EOS
public static final int STV_DECODE_OK
public static final int STV_DECODE_VARIABLE_MISMATCH
public static final int STV_DECODE_DATA_INCOMPLETE
public static final int STV_DECODE_DATA_TOO_SMALL
public static final int STV_DECODE_OBJECT_TOO_SMALL
public static final int STV_ENCODE_OK
public static final int STV_ENCODE_VARIABLE_UNKNOWN
public static final int STV_ENCODE_BUFFER_TOO_SMALL
public static final byte TYPE_CHAR
public static final byte TYPE_WORD
public static final byte TYPE_DWORD
public static final byte TYPE_QWORD
public static final byte TYPE_CHAR_ARRAY
public static final byte TYPE_WORD_ARRAY
public static final byte TYPE_DWORD_ARRAY
public static final byte TYPE_QWORD_ARRAY
public static final byte TYPE_LONG_CHAR_ARRAY
public static final byte TYPE_STRUCT_START
public static final byte TYPE_STRUCT_END
public static final byte TYPE_ARRAY
public static final byte TYPE_SKIP
public static final byte SIZE_CHAR
public static final byte SIZE_WORD
public static final byte SIZE_DWORD
public static final byte SIZE_QWORD
Method Detail |
public int binaryEncode(ObjectRef buffer, ObjectRef rPos)
rPos
- Must be of type long. This is where the first byte of the encoding
is placed. It is also modified to point to the next location after the last encoded byte.
That means that successive calls to this function can be made without modifying position.
Position should be set to 0 on the first call.
Create rPos with a valueOf(long) Example:
ObjectRef rPos = new ObjectRef((long)0) or rPos.valueOf((long)0)
public int binaryDecode(ObjectRef buffer, ObjectRef rPos)
rPos
- Must be of type long. This is where the first byte of the decode
data. Is it also modified to point to the next location after the last decoded byte. That means
that successive calls to this function can be made without modifying position. Position should
be set to 0 on the first call.
Create rPos with a valueOf(long) Example:
ObjectRef rPos = new ObjectRef((long)0) or rPos.valueOf((long)0)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |