net.kano.joscar.snaccmd.icon
Class IconDataCmd

java.lang.Object
  extended bySnacCommand
      extended byIconCommand
          extended byIconDataCmd

public class IconDataCmd
extends IconCommand

A SNAC command containing a buddy's icon. Normally sent in response to an IconRequest.

See Also:
IconRequest
Source of this SNAC:
AIM server
SNAC command type:
Family 0x10, command 0x05

Field Summary
static int CODE_DEFAULT
          The normal value for the extra icon data code of the extra icon information block sent in this command.
 
Fields inherited from class IconCommand
CMD_ICON_DATA, CMD_ICON_REQ, CMD_UPLOAD_ACK, CMD_UPLOAD_ICON, FAMILY_ICON, FAMILY_INFO
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
protected IconDataCmd(SnacPacket packet)
          Generates a new icon data command from the given incoming SNAC packet.
  IconDataCmd(java.lang.String sn, ExtraInfoBlock iconInfo, ByteBlock iconData)
          Creates a new client-bound outgoing buddy icon data command with the given properties.
 
Method Summary
 ByteBlock getIconData()
          The raw buddy icon data.
 ExtraInfoBlock getIconInfo()
          A block of icon information for this icon.
 java.lang.String getScreenname()
          Returns the screenname of the user whose buddy icon this command contains.
 java.lang.String toString()
           
 void writeData(java.io.OutputStream out)
          Writes this command's SNAC data block to the given stream.
 
Methods inherited from class SnacCommand
getCommand, getFamily, getFlag1, getFlag2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CODE_DEFAULT

public static final int CODE_DEFAULT
The normal value for the extra icon data code of the extra icon information block sent in this command.

See Also:
Constant Field Values
Constructor Detail

IconDataCmd

protected IconDataCmd(SnacPacket packet)
Generates a new icon data command from the given incoming SNAC packet.

Parameters:
packet - an incoming icon data packet

IconDataCmd

public IconDataCmd(java.lang.String sn,
                   ExtraInfoBlock iconInfo,
                   ByteBlock iconData)
Creates a new client-bound outgoing buddy icon data command with the given properties.

Parameters:
sn - the screenname of the user whose buddy icon is contained in this command
iconInfo - a block of information about the associated icon
iconData - the raw icon data
Method Detail

getScreenname

public final java.lang.String getScreenname()
Returns the screenname of the user whose buddy icon this command contains.

Returns:
the screenname whose icon this is

getIconInfo

public final ExtraInfoBlock getIconInfo()
A block of icon information for this icon.

Returns:
a block of icon information for this icon

getIconData

public final ByteBlock getIconData()
The raw buddy icon data.

Returns:
the buddy icon data

writeData

public void writeData(java.io.OutputStream out)
               throws java.io.IOException
Description copied from class: SnacCommand
Writes this command's SNAC data block to the given stream. The SNAC data block is the data after the first ten bytes of a SNAC packet.

Specified by:
writeData in class SnacCommand
Parameters:
out - the stream to which to write the SNAC data
Throws:
java.io.IOException - if an I/O error occurs

toString

public java.lang.String toString()