equip.runtime
Class MbufOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byequip.runtime.MbufOutputStream

public class MbufOutputStream
extends java.io.OutputStream

Concrete message buffer (Mbuf) output stream


Field Summary
protected  Mbuf current
           
protected  Mbuf first
           
protected  int mbufHeaderSize
           
protected  int mbufSize
           
protected  int pos
           
 
Constructor Summary
MbufOutputStream()
          initialise to create Mbufs with default size and no header
MbufOutputStream(int mbufSize, int mbufHeaderSize)
          initialise to create Mbufs with given size and header
 
Method Summary
 void flush()
          OutputStream API
 Mbuf takeMbuf()
          Return head of list of Mbufs that have been written into; clears internal reference.
 void write(int bin)
          OutputStream API
 int write2(byte[] cbuf, int size)
          internal implementation of write(int)
 
Methods inherited from class java.io.OutputStream
close, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mbufSize

protected int mbufSize

mbufHeaderSize

protected int mbufHeaderSize

first

protected Mbuf first

current

protected Mbuf current

pos

protected int pos
Constructor Detail

MbufOutputStream

public MbufOutputStream()
initialise to create Mbufs with default size and no header


MbufOutputStream

public MbufOutputStream(int mbufSize,
                        int mbufHeaderSize)
initialise to create Mbufs with given size and header

Method Detail

write

public void write(int bin)
           throws java.io.IOException
OutputStream API

Throws:
java.io.IOException

write2

public int write2(byte[] cbuf,
                  int size)
internal implementation of write(int)


flush

public void flush()
OutputStream API


takeMbuf

public Mbuf takeMbuf()
Return head of list of Mbufs that have been written into; clears internal reference.