ggz.cards.common
Class GGZCardOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by ggz.common.dio.DIOOutputStream
                  extended by ggz.cards.common.GGZCardOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataOutput, java.io.Flushable

public class GGZCardOutputStream
extends DIOOutputStream

This class does not write anything to the output stream until the flush() method is called. All writes first go into an internal buffer so that the size of a packet can be determined. When the flush() method is called, a "packet header" is written that contains the size of the packet (including the header) in bytes.

Author:
Helg.Bredow

Field Summary
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
GGZCardOutputStream(java.io.OutputStream os)
           
 
Method Summary
 void write_card(Card card)
           
 void write_opcode(ClientOpCode opcode)
           
 void write_seat(int seat)
           
 
Methods inherited from class ggz.common.dio.DIOOutputStream
endPacket, writeString
 
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

GGZCardOutputStream

public GGZCardOutputStream(java.io.OutputStream os)
Method Detail

write_card

public void write_card(Card card)
                throws java.io.IOException
Throws:
java.io.IOException

write_opcode

public void write_opcode(ClientOpCode opcode)
                  throws java.io.IOException
Throws:
java.io.IOException

write_seat

public void write_seat(int seat)
                throws java.io.IOException
Throws:
java.io.IOException