Class CNSNetworkMessageFilter.FilterTX

java.lang.Object
org.jcsp.net2.cns.CNSNetworkMessageFilter.FilterTX
All Implemented Interfaces:
NetworkMessageFilter.FilterTx
Enclosing class:
CNSNetworkMessageFilter

static final class CNSNetworkMessageFilter.FilterTX extends Object implements NetworkMessageFilter.FilterTx
The encoding filter used to convert a CNSMessage into bytes
  • Field Details

    • baos

      private final ByteArrayOutputStream baos
      The byte stream we will use to retrieve the byte message from
    • dos

      private final DataOutputStream dos
      The data stream, used to write the parts of the CNSMessage to
  • Constructor Details

    • FilterTX

      FilterTX()
      Creates a new CNS encoding filter
  • Method Details

    • filterTX

      public byte[] filterTX(Object obj) throws IOException
      Converts an object (a CNSMessage) into bytes
      Specified by:
      filterTX in interface NetworkMessageFilter.FilterTx
      Parameters:
      obj - The CNSMessage to convert
      Returns:
      The byte equivalent of the CNSMessage
      Throws:
      IOException - Thrown if something goes wrong during the conversion