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.
-
SendBuffer(int)
- Create a new SendBuffer
-
AppendBytes(byte[])
- Append data to the end of the buffer/queue.
-
RemoveBytes(int)
- Remove up to maxBytes from the buffer.
-
Size()
-
SendBuffer
public SendBuffer(int size)
- Create a new SendBuffer
- Parameters:
- size - size of buffer in bytes
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)
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)
Size
public int Size()
All Packages Class Hierarchy This Package Previous Next Index