Class ObjectNetworkMessageFilter.FilterTX
java.lang.Object
org.jcsp.net2.ObjectNetworkMessageFilter.FilterTX
- All Implemented Interfaces:
NetworkMessageFilter.FilterTx
- Enclosing class:
ObjectNetworkMessageFilter
public static final class ObjectNetworkMessageFilter.FilterTX
extends Object
implements NetworkMessageFilter.FilterTx
The sending (encoding) filter for Object channels
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResettableByteArrayOutputStreamThe output stream to get the bytes fromprivate final ObjectOutputStreamThe ObjectOutputStream connected to the byte stream to allow the serialization of objects -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
baos
The output stream to get the bytes from -
oos
The ObjectOutputStream connected to the byte stream to allow the serialization of objects
-
-
Constructor Details
-
FilterTX
public FilterTX()Creates a new encoding object filter
-
-
Method Details
-
filterTX
Encodes an object into bytes by using Object serialization- Specified by:
filterTXin interfaceNetworkMessageFilter.FilterTx- Parameters:
obj- The Object to serialize- Returns:
- The byte array equivalent of the object
- Throws:
IOException- Thrown if something goes wrong during the serialization
-