|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.multicast.util.Util
Utility class for reading and writing bigendian integers to and from a byte array. This class is used for encoding and decoding network packets.
Method Summary | |
static java.lang.Object |
deepClone(java.lang.Object object)
Perform a deep clone of an object. |
static int |
InetAddressToInt(java.net.InetAddress ia)
Converts an InetAddress into an int. |
static java.net.InetAddress |
intToInetAddress(int address)
Converts an int into an InetAddress. |
static int |
readInt(byte[] arr,
int pos)
Reads a signed int (4 byte bigendian integer) from a byte array starting at index pos. |
static long |
readLong(byte[] arr,
int pos)
Reads a signed long (8 byte bigendian integer) from a byte array starting at index pos. |
static java.lang.Object |
readObject(byte[] bytes)
Read an object from a byte array using serialization. |
static long |
readUnsignedInt(byte[] arr,
int pos)
Reads an unsigned int (4 byte bigendian integer) from a byte array starting at index pos. |
static int |
readUnsignedShort(byte[] arr,
int pos)
Reads an unsigned short (2 byte bigendian integer) from a byte array starting at index pos. |
static void |
writeByteArrayToFile(byte[] buf,
java.lang.String fileName,
int len)
Method to write a byte array to a file. |
static void |
writeInt(int i,
byte[] arr,
int pos)
Writes a signed int (4 byte bigendian integer) to a byte array starting at index pos. |
static void |
writeLong(long l,
byte[] arr,
int pos)
Writes a signed long (8 byte bigendian integer) to a byte array starting at index pos. |
static byte[] |
writeObject(java.lang.Object object)
Write an object to a byte array using serialization. |
static void |
writeShort(short s,
byte[] arr,
int pos)
Writes a signed short (2 byte bigendian integer) to a byte array starting at index pos. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static int readUnsignedShort(byte[] arr, int pos)
arr
- the byte arraypos
- the index into the byte arraypublic static void writeShort(short s, byte[] arr, int pos)
s
- the signed shortarr
- the byte arraypos
- the index into the byte arraypublic static long readUnsignedInt(byte[] arr, int pos)
arr
- the byte arraypos
- the index into the byte arraypublic static int readInt(byte[] arr, int pos)
arr
- the byte arraypos
- the index into the byte arraypublic static void writeInt(int i, byte[] arr, int pos)
i
- the signed intarr
- the byte arraypos
- the index into the byte arraypublic static long readLong(byte[] arr, int pos)
arr
- the byte arraypos
- the index into the byte arraypublic static void writeLong(long l, byte[] arr, int pos)
l
- the signed longarr
- the byte arraypos
- the index into the byte arraypublic static java.net.InetAddress intToInetAddress(int address)
address
- the intpublic static int InetAddressToInt(java.net.InetAddress ia)
ia
- the InetAddresspublic static java.lang.Object readObject(byte[] bytes)
object
- the byte stream to readpublic static byte[] writeObject(java.lang.Object object)
object
- the object to be writtenpublic static java.lang.Object deepClone(java.lang.Object object)
object
- the object to be clonedpublic static void writeByteArrayToFile(byte[] buf, java.lang.String fileName, int len) throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.