Package org.jcsp.net2
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 java.lang.Object implements NetworkMessageFilter.FilterTx
The sending (encoding) filter for Object channels
-
-
Field Summary
Fields Modifier and Type Field Description private ResettableByteArrayOutputStream
baos
The output stream to get the bytes fromprivate java.io.ObjectOutputStream
oos
The ObjectOutputStream connected to the byte stream to allow the serialization of objects
-
Constructor Summary
Constructors Constructor Description FilterTX()
Creates a new encoding object filter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
filterTX(java.lang.Object obj)
Encodes an object into bytes by using Object serialization
-
-
-
Field Detail
-
baos
private final ResettableByteArrayOutputStream baos
The output stream to get the bytes from
-
oos
private final java.io.ObjectOutputStream oos
The ObjectOutputStream connected to the byte stream to allow the serialization of objects
-
-
Method Detail
-
filterTX
public byte[] filterTX(java.lang.Object obj) throws java.io.IOException
Encodes an object into bytes by using Object serialization- Specified by:
filterTX
in interfaceNetworkMessageFilter.FilterTx
- Parameters:
obj
- The Object to serialize- Returns:
- The byte array equivalent of the object
- Throws:
java.io.IOException
- Thrown if something goes wrong during the serialization
-
-