Class BNSNetworkMessageFilter.FilterTX

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

static final class BNSNetworkMessageFilter.FilterTX extends Object implements NetworkMessageFilter.FilterTx
The encoding filter used to convert a BNSMessage 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 BNSMessage to
  • Constructor Details

    • FilterTX

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

    • filterTX

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