@Override
 public NetMessage unmarshal(InputStream in) {
   SoapEnvelope msg = SoapSerializer.FromXml(in);
   NetMessage message = Builder.soapToNetMessage(msg);
   EncodingStats.newSoapDecodedMessage();
   return message;
 }
  @Override
  public NetMessage unmarshal(byte[] packet) {
    UnsynchronizedByteArrayInputStream bin = new UnsynchronizedByteArrayInputStream(packet);
    SoapEnvelope msg = SoapSerializer.FromXml(bin);

    NetMessage message = Builder.soapToNetMessage(msg);
    EncodingStats.newSoapDecodedMessage();
    return message;
  }
 @Override
 public byte[] marshal(NetMessage message) {
   SoapEnvelope soap = Builder.netMessageToSoap(message);
   UnsynchronizedByteArrayOutputStream holder = new UnsynchronizedByteArrayOutputStream();
   SoapSerializer.ToXml(soap, holder);
   byte[] data = holder.toByteArray();
   EncodingStats.newSoapEncodedMessage();
   return data;
 }
 @Override
 public void marshal(NetMessage message, OutputStream out) {
   SoapEnvelope soap = Builder.netMessageToSoap(message);
   SoapSerializer.ToXml(soap, out);
   EncodingStats.newSoapEncodedMessage();
 }