com.healthmarketscience.rmiio
Class PacketOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.healthmarketscience.rmiio.PacketOutputStream
All Implemented Interfaces:
Closeable, Flushable
Direct Known Subclasses:
PipeBuffer.OutputStreamAdapter

public abstract class PacketOutputStream
extends OutputStream

Adds support for packet based access to data from an OutputStream. Can be more effecient for certain stream implementations, especially for remote stream usage where data is coming across the wire in byte[] packets.

Author:
James Ahlborn

Constructor Summary
PacketOutputStream()
           
 
Method Summary
abstract  void writePacket(byte[] packet)
          Puts the given "packet" into the output stream.
 
Methods inherited from class java.io.OutputStream
close, flush, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PacketOutputStream

public PacketOutputStream()
Method Detail

writePacket

public abstract void writePacket(byte[] packet)
                          throws IOException
Puts the given "packet" into the output stream. The packet should be filled with data. The caller is giving control of the buffer to the PacketOutputStream, and therefore should not attempt to use the byte[] again.

Parameters:
packet - fully filled array of bytes to give to the OutputStream
Throws:
IOException


Copyright © 2006–2016 Health Market Science. All rights reserved.