Package org.jcsp.net2

Class ObjectNetworkMessageFilter.FilterTX

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ResettableByteArrayOutputStream baos
      The output stream to get the bytes from
      private 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • oos

        private final java.io.ObjectOutputStream oos
        The ObjectOutputStream connected to the byte stream to allow the serialization of objects
    • Constructor Detail

      • FilterTX

        public FilterTX()
        Creates a new encoding object filter
    • 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 interface NetworkMessageFilter.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