public class LEAPFrameCodec extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
private static byte |
AGGREGATE |
private static byte |
BOOLEAN |
private static byte |
BYTE_SEQUENCE |
private static byte |
CONTENT_ELEMENT_LIST |
private static byte |
DATE |
private static byte |
ELEMENT |
private static byte |
END |
private static byte |
FLOAT |
private static byte |
INTEGER |
private static byte |
MODIFIER |
static String |
NAME |
private static byte |
OBJECT |
private ByteArrayOutputStream |
outBuffer |
private DataOutputStream |
outStream |
private static byte |
STRING |
private Vector |
stringReferences |
private static byte |
UNMODIFIER |
Constructor and Description |
---|
LEAPFrameCodec() |
Modifier and Type | Method and Description |
---|---|
private QualifiedFrame |
aidToFrame(AID id) |
Frame |
decode(byte[] content)
Transform a sequence of bytes encoded according to the LEAP
language into a Frame
|
byte[] |
encode(Frame content)
Transform a Frame into a sequence of bytes encoded according to the
LEAP language
|
private void |
fillOrderedFrame(DataInputStream stream,
OrderedFrame f) |
private AID |
frameToAid(QualifiedFrame f) |
private Object |
read(DataInputStream stream) |
private void |
readObject(ObjectInputStream oin) |
private String |
readString(DataInputStream stream,
byte tag) |
private void |
write(DataOutputStream stream,
Object obj) |
private void |
writeString(DataOutputStream stream,
byte tag,
String s) |
public static final String NAME
private transient ByteArrayOutputStream outBuffer
private transient DataOutputStream outStream
private transient Vector stringReferences
private static final byte STRING
private static final byte BOOLEAN
private static final byte INTEGER
private static final byte FLOAT
private static final byte DATE
private static final byte BYTE_SEQUENCE
private static final byte AGGREGATE
private static final byte CONTENT_ELEMENT_LIST
private static final byte OBJECT
private static final byte ELEMENT
private static final byte END
private static final byte MODIFIER
private static final byte UNMODIFIER
private void readObject(ObjectInputStream oin) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public byte[] encode(Frame content) throws FrameException
content
- The Frame to be transformedFrameException
public Frame decode(byte[] content) throws FrameException
content
- The sequence of bytes to be transformed.FrameException
private void write(DataOutputStream stream, Object obj) throws Throwable
Throwable
private Object read(DataInputStream stream) throws Throwable
Throwable
private void fillOrderedFrame(DataInputStream stream, OrderedFrame f) throws Throwable
Throwable
private final void writeString(DataOutputStream stream, byte tag, String s) throws Throwable
Throwable
private final String readString(DataInputStream stream, byte tag) throws Throwable
Throwable
private final QualifiedFrame aidToFrame(AID id)
private final AID frameToAid(QualifiedFrame f)