com.softsynth.jmsl.net
Class NetStreamer

java.lang.Object
  extended by com.softsynth.jmsl.net.NetStreamer

public class NetStreamer
extends java.lang.Object

Experimental, untested. May disappear in future versions. Send or retrieve a serializable JMSL Object to/from a URL as an ObjectOutputStream. To send MusicShape data, send the raw Vector of its data elements, pulled with MusicShape's getData() method.

Author:
Nick Didkovsky and Phil Burk

Constructor Summary
NetStreamer()
           
 
Method Summary
static java.io.ObjectInputStream read(java.net.URL url)
          Read a serializable Object from a URL.
static java.io.DataInputStream write(java.net.URL url, java.io.Serializable object)
          Write a serializable Object to a URL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetStreamer

public NetStreamer()
Method Detail

write

public static java.io.DataInputStream write(java.net.URL url,
                                            java.io.Serializable object)
                                     throws java.io.IOException,
                                            java.net.MalformedURLException
Write a serializable Object to a URL. Assumes a CGI script or Servlet is at the URL, and parses the parameter "jmslnetaction" and retrieves JMSLNetActions.POST_OBJECT, and knows that this means to open an ObjectInputStream from this connection and read in the Object this method is sending.

Returns:
DataInputStream sent back from server. Used, for example, to simply send an integer indicating all's well
Throws:
java.io.IOException
java.net.MalformedURLException

read

public static java.io.ObjectInputStream read(java.net.URL url)
                                      throws java.io.IOException,
                                             java.net.MalformedURLException
Read a serializable Object from a URL. Assumes a CGI script or Servlet is at the URL, and parses the parameter "jmslnetaction", retrieves JMSLNetActions.REQUEST_OBJECT, and knows that this means to open an ObjectOutputStream from this connection and send an Object.

Returns:
ObjectInputStream sent from server. Used to readObject()
Throws:
java.io.IOException
java.net.MalformedURLException