OSMQ
v2.0.1

osmq.io
Class PacketOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byosmq.io.PacketOutputStream
All Implemented Interfaces:
WriterStream
Direct Known Subclasses:
PacketFileOutputStream, ZipPacketFileOutputStream, ZipPacketOutputStream

public class PacketOutputStream
extends java.io.FilterOutputStream
implements WriterStream


Field Summary
static byte[] NULL_INT_ARRAY
           
 
Constructor Summary
PacketOutputStream(java.io.OutputStream out)
           
 
Method Summary
 void println(java.lang.String s)
           
 void write(byte[] b, int offset, int size)
          Writes the byte array to the underlying output stream, maintaining size information so that the corollary BytePacketReader can fetch packets in the same byte size units.
 void writeBytes(byte[] value)
           
 void writeNull()
          Writes a null object to the stream which is ignored by the corresponding PacketInputStream.
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface osmq.io.WriterStream
close, flush
 

Field Detail

NULL_INT_ARRAY

public static final byte[] NULL_INT_ARRAY
Constructor Detail

PacketOutputStream

public PacketOutputStream(java.io.OutputStream out)
Method Detail

writeNull

public void writeNull()
               throws java.io.IOException
Writes a null object to the stream which is ignored by the corresponding PacketInputStream. This method is used for testing whether a socket stream is still active.

Specified by:
writeNull in interface WriterStream
Throws:
java.io.IOException

println

public void println(java.lang.String s)
             throws java.io.IOException
Specified by:
println in interface WriterStream
Throws:
java.io.IOException

writeBytes

public void writeBytes(byte[] value)
                throws java.io.IOException
Specified by:
writeBytes in interface WriterStream
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int offset,
                  int size)
           throws java.io.IOException
Writes the byte array to the underlying output stream, maintaining size information so that the corollary BytePacketReader can fetch packets in the same byte size units.

This method overrides the base method of any underlying OutputStream implementation.

Throws:
java.io.IOException

(c) 2000 - 2003 MQue Systems
All Rights Reserved