org.walluck.oscar
Class AIMOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byjava.io.DataOutputStream
              extended byorg.walluck.io.DataOutputStreamEx
                  extended byorg.walluck.io.LittleEndianOutputStream
                      extended byorg.walluck.oscar.AIMOutputStream
All Implemented Interfaces:
java.io.DataOutput

public class AIMOutputStream
extends LittleEndianOutputStream

An output stream that supports the writing of AIM objects.

Since:
1.0
Version:
1.0
Author:
David Walluck
See Also:
LittleEndianOutputStream

Field Summary
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
AIMOutputStream()
          Creates a new AIM output stream with the default size of 100 bytes.
AIMOutputStream(int size)
          Creates a new AIM output stream of the specified size.
AIMOutputStream(java.io.OutputStream os)
          Creates a new AIM output stream given an underlying output stream.
 
Method Summary
 byte[] getBytes()
          Get the byte array that underlies this stream.
 void writeCaps(int caps)
          Write a capability block to this stream.
 void writeDirectIMHeader(DirectIMHeader dh)
          Write a direct IM header to this stream.
 void writeFileHeader(FileHeader fh)
          Write a file header to this stream.
 void writeFLAP(FLAP flap)
          Writes a FLAP to this stream.
 void writeFTTLV(FTTLV fttlv)
          Write a file transfer TLV to this stream.
 void writeGetFileEntries(java.util.ArrayList files)
          Write a set of GetFile entries to this stream.
 void writeGetFileList(GetFileList gfl)
          Write a GetFile listing to this stream.
 void writeICBM(byte[] cookie, short channel, java.lang.String sn)
          Write an ICBM to this stream.
 void writeICQColor(ICQColor color)
          Write an ICQ color to this stream.
 void writeProxyPacket(ProxyPacket proxyPacket)
          Write an AOL Proxy packet to this stream.
 void writeRendezvous(Rendezvous rv)
          Write a Rendezvous to this stream.
 void writeSNAC(SNAC snac)
          Writes a SNAC to this output stream.
 void writeStats(java.util.ArrayList stats, int type)
          Write a stats vector to this stream.
 void writeTLVChain(TLVChain tlvchain)
          Writes a TLV chain to this output stream.
 void writeUserInfo(UserInfo info)
          Write a user info class to this stream.
 
Methods inherited from class org.walluck.io.LittleEndianOutputStream
writeIntLE, writeShortLE, writeStringLLLE0
 
Methods inherited from class org.walluck.io.DataOutputStreamEx
writeBytes, writeString, writeString0, writeStringL, writeStringLL, writeStringLL0, writeStringNullPadded
 
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write
 

Constructor Detail

AIMOutputStream

public AIMOutputStream(java.io.OutputStream os)
Creates a new AIM output stream given an underlying output stream.

Parameters:
os - the underlying output stream to use

AIMOutputStream

public AIMOutputStream()
Creates a new AIM output stream with the default size of 100 bytes.


AIMOutputStream

public AIMOutputStream(int size)
Creates a new AIM output stream of the specified size.

Parameters:
size - the size of this output stream
Method Detail

writeFLAP

public void writeFLAP(FLAP flap)
               throws java.io.IOException
Writes a FLAP to this stream.

Parameters:
flap - the FLAP to write
Throws:
java.io.IOException - if an error occurs

writeSNAC

public void writeSNAC(SNAC snac)
               throws java.io.IOException
Writes a SNAC to this output stream.

Parameters:
snac - the SNAC to write
Throws:
java.io.IOException - if an error occurs

writeTLVChain

public void writeTLVChain(TLVChain tlvchain)
                   throws java.io.IOException
Writes a TLV chain to this output stream.

Parameters:
tlvchain - the TLV chain to write
Throws:
java.io.IOException - if an error occurs

writeFTTLV

public void writeFTTLV(FTTLV fttlv)
                throws java.io.IOException
Write a file transfer TLV to this stream.

Parameters:
fttlv - the file transfer TLV to write
Throws:
java.io.IOException - if an error occurs

writeCaps

public void writeCaps(int caps)
               throws java.io.IOException
Write a capability block to this stream.

Parameters:
caps - the capability block to write
Throws:
java.io.IOException - if an error occurs

writeUserInfo

public void writeUserInfo(UserInfo info)
                   throws java.io.IOException
Write a user info class to this stream.

Parameters:
info - the user info class to write
Throws:
java.io.IOException - if an error occurs

writeStats

public void writeStats(java.util.ArrayList stats,
                       int type)
                throws java.io.IOException
Write a stats vector to this stream.

Parameters:
stats - the stats vector
type - the type of stat to write
Throws:
java.io.IOException - if an error occurs

writeDirectIMHeader

public void writeDirectIMHeader(DirectIMHeader dh)
                         throws java.io.IOException
Write a direct IM header to this stream.

Parameters:
dh - the direct IM header
Throws:
java.io.IOException - if an error occurs

writeFileHeader

public void writeFileHeader(FileHeader fh)
                     throws java.io.IOException
Write a file header to this stream.

Parameters:
fh - the file header to write
Throws:
java.io.IOException - if an error occurs

writeGetFileEntries

public void writeGetFileEntries(java.util.ArrayList files)
                         throws java.io.IOException
Write a set of GetFile entries to this stream.

Parameters:
files - the GetFile entries to write
Throws:
java.io.IOException - if an error occurs

writeGetFileList

public void writeGetFileList(GetFileList gfl)
                      throws java.io.IOException
Write a GetFile listing to this stream.

Parameters:
gfl - the GetFile listing to write
Throws:
java.io.IOException - if an error occurs

writeProxyPacket

public void writeProxyPacket(ProxyPacket proxyPacket)
                      throws java.io.IOException
Write an AOL Proxy packet to this stream.

Parameters:
proxyPacket - the packet
Throws:
java.io.IOException - if an error occurs

writeICQColor

public void writeICQColor(ICQColor color)
                   throws java.io.IOException
Write an ICQ color to this stream.

Parameters:
color - the ICQ color
Throws:
java.io.IOException - if an error occurs

writeICBM

public void writeICBM(byte[] cookie,
                      short channel,
                      java.lang.String sn)
               throws java.io.IOException
Write an ICBM to this stream.

Parameters:
cookie - the cookie
channel - the channel
sn - the screenname
Throws:
java.io.IOException - if an error occurs

writeRendezvous

public void writeRendezvous(Rendezvous rv)
                     throws java.io.IOException
Write a Rendezvous to this stream.

Parameters:
rv - the Rendezvous to write
Throws:
java.io.IOException - if an error occurs

getBytes

public byte[] getBytes()
                throws java.io.IOException
Get the byte array that underlies this stream.

Returns:
the underlying byte array
Throws:
java.io.IOException - if an error occurs