j_waste.network
Class ChatReplyPacket

java.lang.Object
  extended byj_waste.network.Packet
      extended byj_waste.network.HeadedPacket
          extended byj_waste.network.ChatReplyPacket
All Implemented Interfaces:
NetworkConstants

public class ChatReplyPacket
extends HeadedPacket
implements NetworkConstants

This is the class for the Chat Reply packet type.

Version:
0.2
Author:
Jan Lindblom (cl0wn@users.sourceforge.net), Mattias Ek (matek@users.sourceforge.net)

Field Summary
 
Fields inherited from class j_waste.network.HeadedPacket
iscomplete, packetData, padBytes
 
Fields inherited from class j_waste.network.Packet
packet
 
Fields inherited from interface j_waste.network.NetworkConstants
ABORT, CAP_BANDWIDTH, CAP_REMOTE_IP, CAP_SATURATION, GENERAL_TYPE_BROADCAST, GENERAL_TYPE_LOCAL, GENERAL_TYPE_ROUTED, HEADER_SIZE, MAX_BROADCAST_SIZE, MAX_ROUTED_SIZE, NO_ABORT, PREMATURE_ABORT, PRIO_CHAT, PRIO_CHAT_REPLY, PRIO_FILE_REQ_REPLY, PRIO_FILE_REQUEST, PRIO_KEYDIST, PRIO_KEYDIST_REPLY, PRIO_LCAPS, PRIO_LOCAL_SATURATE, PRIO_PING, PRIO_SEARCH, PRIO_SEARCH_REPLY, PRIO_SEARCH_USERLIST, PRIO_UPLOAD, TYPE_CHAT, TYPE_CHAT_REPLY, TYPE_FILE_REQ_REPLY, TYPE_FILE_REQUEST, TYPE_KEYDIST, TYPE_KEYDIST_REPLY, TYPE_LCAPS, TYPE_LOCAL_SATURATE, TYPE_PING, TYPE_SEARCH, TYPE_SEARCH_REPLY, TYPE_SEARCH_USERLIST, TYPE_UPLOAD
 
Constructor Summary
ChatReplyPacket()
          Base constructor, creates an empty ChatReplyPacket.
ChatReplyPacket(byte[] pkg)
          Constructs a ChatReplyPacket given a byte array representation of the Packet.
ChatReplyPacket(java.lang.String s)
          Constructs a ChatReplyPacket with given sender, recipient and message.
ChatReplyPacket(java.lang.String s, byte[] guid)
          Constructs a ChatReplyPacket with given sender, recipient, message and GUID.
 
Method Summary
 void finalizePacket()
          Finalizes this ChatReplyPacket.
 java.lang.String getSender()
          Returns the sender of this ChatReplyPacket.
 void setSender(java.lang.String s)
          Sets the sender of this ChatReplyPacket.
 byte[] toByteArray()
          Returns a byte array representation of the packet.
 
Methods inherited from class j_waste.network.HeadedPacket
createPacket, getData, getGeneralType, getGUID, getHeader, getIntPrio, getIntType, getLength, getMD5, getPrio, getTTL, getType, setLength, setTTL
 
Methods inherited from class j_waste.network.Packet
padCD, reverseBytes, reverseInt, reverseShort, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChatReplyPacket

public ChatReplyPacket()
Base constructor, creates an empty ChatReplyPacket.


ChatReplyPacket

public ChatReplyPacket(java.lang.String s)
Constructs a ChatReplyPacket with given sender, recipient and message.

Parameters:
s - the sender.

ChatReplyPacket

public ChatReplyPacket(java.lang.String s,
                       byte[] guid)
Constructs a ChatReplyPacket with given sender, recipient, message and GUID.

Parameters:
s - the sender.
guid - the GUID.

ChatReplyPacket

public ChatReplyPacket(byte[] pkg)
                throws InvalidPacketException
Constructs a ChatReplyPacket given a byte array representation of the Packet.

Parameters:
pkg - the Packet.
Method Detail

setSender

public void setSender(java.lang.String s)
Sets the sender of this ChatReplyPacket.

Parameters:
s - the sender.

getSender

public java.lang.String getSender()
Returns the sender of this ChatReplyPacket.

Returns:
the sender.

finalizePacket

public void finalizePacket()
Finalizes this ChatReplyPacket.

Overrides:
finalizePacket in class HeadedPacket

toByteArray

public byte[] toByteArray()
Returns a byte array representation of the packet.

Overrides:
toByteArray in class HeadedPacket
Returns:
a byte array representation of the packet.