All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class reliability.SendBuffer

java.lang.Object
   |
   +----timer.TimerClient
           |
           +----reliability.SendBuffer

public class SendBuffer
extends TimerClient
A specialized bounded-buffer for sending. This buffer has the semantics that appends will wait for space but removes will always return immediately.


Constructor Index

 o SendBuffer(int)
Create a new SendBuffer

Method Index

 o AppendBytes(byte[])
Append data to the end of the buffer/queue.
 o RemoveBytes(int)
Remove up to maxBytes from the buffer.
 o Size()

Constructors

 o SendBuffer
 public SendBuffer(int size)
Create a new SendBuffer

Parameters:
size - size of buffer in bytes

Methods

 o AppendBytes
 public int AppendBytes(byte data[])
Append data to the end of the buffer/queue. If there is no room, then block until space becomes available.

Returns:
the old number of bytes in the buffer (before the insertion)
 o RemoveBytes
 public byte[] RemoveBytes(int maxBytes)
Remove up to maxBytes from the buffer. If less or no data is available, then return what is available (may return a zero-length array)

 o Size
 public int Size()

All Packages  Class Hierarchy  This Package  Previous  Next  Index