package examples.mega.client;

import java.io.ByteArrayInputStream;

import java.rmi.RemoteException;

import javax.activation.DataHandler;
import javax.xml.transform.stream.StreamSource;

public class Attachment{

  public void invoke( MegaPort port ) throws RemoteException,
      InvokeFailedException {

    ByteArrayInputStream stream = new ByteArrayInputStream(
        "<some><data/><like/><this/><here/></some>".getBytes() );

    DataHandler handler = port.methodWithAttachments( 
        "Hi there", new StreamSource( stream ), 
        new DataHandler( "This is plain text", "text/plain" ) );
  }
}

