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 java.lang.Object implements NetworkMessageFilter.FilterRx
The receiving (decoding) filter for Objects
-
-
Field Summary
Fields Modifier and Type Field Description private ResettableByteArrayInputStream
bais
The byte array stream used to connect to the ObjectInputStream(package private) static byte[]
objectStreamHeader
These four bytes represent the normal header expected in Java for object streamsprivate java.io.ObjectInputStream
ois
The ObjectInputStream used to read the objects from.
-
Constructor Summary
Constructors Constructor Description FilterRX()
Creates a new incoming object filter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
filterRX(byte[] bytes)
Decodes an incoming byte array, converting it back into an Object
-
-
-
Field Detail
-
objectStreamHeader
static final byte[] objectStreamHeader
These four bytes represent the normal header expected in Java for object streams
-
bais
private final ResettableByteArrayInputStream bais
The byte array stream used to connect to the ObjectInputStream
-
ois
private final java.io.ObjectInputStream ois
The ObjectInputStream used to read the objects from.
-
-
Method Detail
-
filterRX
public java.lang.Object filterRX(byte[] bytes) throws java.io.IOException
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:
java.io.IOException
- Thrown of something goes wrong during the decoding
-
-