@Override public SoapEnvelope decode(DataInputStream in) throws IOException { int len = in.readInt(); byte[] buf = new byte[len]; in.readFully(buf); UnsynchByteArrayInputStream holder = new UnsynchByteArrayInputStream(buf); return SoapSerializer.FromXml(holder); }
@Override public void encode(SoapEnvelope message, DataOutputStream out) throws IOException { UnsynchByteArrayOutputStream holder = new UnsynchByteArrayOutputStream(); SoapSerializer.ToXml(message, holder); byte[] buf = holder.toByteArray(); out.writeInt(buf.length); out.write(buf); }
public SoapEnvelope unmarshal(byte[] message) { UnsynchByteArrayInputStream bin = new UnsynchByteArrayInputStream(message); SoapEnvelope msg = SoapSerializer.FromXml(bin); return msg; }