Package org.jcsp.net2
Class ObjectNetworkMessageFilter.FilterRX
java.lang.Object
org.jcsp.net2.ObjectNetworkMessageFilter.FilterRX
- All Implemented Interfaces:
NetworkMessageFilter.FilterRx
- Enclosing class:
- ObjectNetworkMessageFilter
public static final class ObjectNetworkMessageFilter.FilterRX
extends Object
implements NetworkMessageFilter.FilterRx
The receiving (decoding) filter for Objects
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResettableByteArrayInputStream
The byte array stream used to connect to the ObjectInputStream(package private) static final byte[]
These four bytes represent the normal header expected in Java for object streamsprivate final ObjectInputStream
The ObjectInputStream used to read the objects from. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
objectStreamHeader
static final byte[] objectStreamHeaderThese four bytes represent the normal header expected in Java for object streams -
bais
The byte array stream used to connect to the ObjectInputStream -
ois
The ObjectInputStream used to read the objects from.
-
-
Constructor Details
-
FilterRX
public FilterRX()Creates a new incoming object filter
-
-
Method Details
-
filterRX
Decodes an incoming byte array, converting it back into an Object- Specified by:
filterRX
in interfaceNetworkMessageFilter.FilterRx
- Parameters:
bytes
- The byte representation of the object- Returns:
- The recreated Object
- Throws:
IOException
- Thrown of something goes wrong during the decoding
-