try
{
CompressedMessage cMessage = new CompressedMessage(messageArea.getText(), false);
cMessage.compressMessage();
EncryptedMessage eMessage = new EncryptedMessage(MessageType.USERMESSAGE, "", cMessage);
outputStream.writeObject(eMessage);
}
catch (IOException e1)
{
System.out.println(e1);
System.exit(1);
}
我正在尝试向服务器(本地atm)发送消息,在尝试发送EncryptedMessage对象之前(在字符串中)发送数据时没有问题。
public class EncryptedMessage
{
private MessageType type;
private String receipent;
private CompressedMessage message;
public EncryptedMessage(MessageType T, String R, CompressedMessage mes)
{
type = T;
receipent = R;
message = mes;
}
public MessageType getType()
{
return type;
}
public void setType(MessageType type)
{
this.type = type;
}
public String getReceipent()
{
return receipent;
}
public void setReceipent(String receipent)
{
this.receipent = receipent;
}
public CompressedMessage getMessage()
{
return message;
}
}
非常感谢任何帮助