package javax.wireless.messaging;

import java.io.IOException;
import java.io.InterruptedIOException;
import javax.microedition.io.Connection;

public interface MessageConnection extends Connection
{
 public String BINARY_MESSAGE = "binary";
 public String TEXT_MESSAGE = "text";
 public String MULTIPART_MESSAGE = "multipart";

 public Message newMessage(String);
 
 public Message newMessage(String, String);
 
 public int numberOfSegments(Message);
 
 public Message receive() throws InterruptedIOException, IOException;
 
 public void send(Message) throws InterruptedIOException, IOException;
 
 public void setMessageListener(MessageListener) throws IOException;
 
}