All Packages Class Hierarchy This Package Previous Next Index
Class JavaGroups.Util
java.lang.Object
|
+----JavaGroups.Util
- public class Util
- extends Object
Collection of various utility routines that can not be assigned to other classes.
-
Util()
-
-
DefragmentBuffer(Vector)
- Concatenates smaller fragments into entire buffers.
-
DumpStack(boolean)
-
-
FragmentBuffer(byte[], int)
- Fragments a byte buffer into smaller fragments of (max.) frag_size.
-
main(String[])
-
-
ObjectFromByteBuffer(byte[])
- Creates an object from a byte buffer
-
ObjectToByteBuffer(Serializable)
- Serializes an object into a byte buffer.
-
Print(String)
-
-
PrintFragments(Vector)
-
Util
public Util()
ObjectFromByteBuffer
public static Object ObjectFromByteBuffer(byte buffer[]) throws Exception
- Creates an object from a byte buffer
ObjectToByteBuffer
public static byte[] ObjectToByteBuffer(Serializable obj) throws Exception
- Serializes an object into a byte buffer.
The object has to implement interface Serializable.
DumpStack
public static void DumpStack(boolean exit)
Print
public static void Print(String msg)
FragmentBuffer
public static Vector FragmentBuffer(byte buf[],
int frag_size)
- Fragments a byte buffer into smaller fragments of (max.) frag_size.
Example: a byte buffer of 1024 bytes and a frag_size of 248 gives 4 fragments
of 248 bytes each and 1 fragment of 32 bytes.
- Returns:
- A vector of byte buffers (
byte[]
).
DefragmentBuffer
public static byte[] DefragmentBuffer(Vector fragments)
- Concatenates smaller fragments into entire buffers.
- Parameters:
- fragments - A vector of byte buffers (
byte[]
)
- Returns:
- A byte buffer
PrintFragments
public static void PrintFragments(Vector frags)
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index