| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjist.swans.misc.Pickle
public final class Pickle
Utility class to simplify the serialization and deserialization of various data types.
| Constructor Summary | |
|---|---|
| Pickle() | |
| Method Summary | |
|---|---|
| static java.net.InetAddress | arrayToInetAddress(byte[] addr,
                   int offset) | 
| static int | arrayToInteger(byte[] b,
               int offset) | 
| static java.lang.Object | arrayToObject(byte[] b) | 
| static java.lang.Object | arrayToObject(byte[] b,
              int offset) | 
| static short | arrayToShort(byte[] b,
             int offset) | 
| static java.lang.String | arrayToString(byte[] b,
              int offset) | 
| static int | arrayToUByte(byte[] b,
             int offset) | 
| static long | arrayToUInt(byte[] b,
            int offset) | 
| static int | arrayToUShort(byte[] b,
              int offset) | 
| static int[] | byteToIntArray(byte[] data) | 
| static int[] | byteToIntArray(byte[] data,
               int offset,
               int length)Handle "unsigned" byte arrays containing numbers larger than 128 (bytes are signed, so convert into ints) | 
| static byte[] | concat(byte[] b1,
       byte[] b2) | 
| static java.util.Vector | Enum2Vector(java.util.Enumeration e)Utility method to stuff an entire enumeration into a vector | 
| static int | getLength(byte[] b,
          int offset)String: size = variable | 
| static void | InetAddressToArray(java.net.InetAddress inet,
                   byte[] b,
                   int offset)InetAddress: size = 4 | 
| static void | integerToArray(int integer,
               byte[] b,
               int offset)Integer: size = 4 | 
| static byte[] | intToByteArray(int[] data) | 
| static byte[] | intToByteArray(int[] data,
               int offset,
               int length) | 
| static byte[] | messageBytes(Message m) | 
| static byte[] | objectToArray(java.lang.Object s)Object: size = variable | 
| static void | printByteArrayNicely(byte[] a) | 
| static void | printByteArrayNicely(byte[] a,
                     int offset,
                     int length) | 
| static void | printlnByteArrayNicely(byte[] a) | 
| static void | printlnByteArrayNicely(byte[] a,
                       int offset,
                       int length) | 
| static void | shortToArray(short i,
             byte[] b,
             int offset)Short: size = 2 | 
| static byte[] | stringToArray(java.lang.String s) | 
| static void | ubyteToArray(int ubyte,
             byte[] b,
             int offset) | 
| static void | uintToArray(long uint,
            byte[] b,
            int offset) | 
| static void | ushortToArray(int ushort,
              byte[] b,
              int offset) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public Pickle()
| Method Detail | 
|---|
public static void printByteArrayNicely(byte[] a)
public static void printByteArrayNicely(byte[] a,
                                        int offset,
                                        int length)
public static void printlnByteArrayNicely(byte[] a,
                                          int offset,
                                          int length)
public static void printlnByteArrayNicely(byte[] a)
public static java.util.Vector Enum2Vector(java.util.Enumeration e)
public static int[] byteToIntArray(byte[] data,
                                   int offset,
                                   int length)
public static byte[] intToByteArray(int[] data,
                                    int offset,
                                    int length)
public static int[] byteToIntArray(byte[] data)
public static byte[] intToByteArray(int[] data)
public static byte[] concat(byte[] b1,
                            byte[] b2)
public static final void ubyteToArray(int ubyte,
                                      byte[] b,
                                      int offset)
public static final int arrayToUByte(byte[] b,
                                     int offset)
public static final void ushortToArray(int ushort,
                                       byte[] b,
                                       int offset)
public static final int arrayToUShort(byte[] b,
                                      int offset)
public static final void uintToArray(long uint,
                                     byte[] b,
                                     int offset)
public static final long arrayToUInt(byte[] b,
                                     int offset)
public static void integerToArray(int integer,
                                  byte[] b,
                                  int offset)
public static int arrayToInteger(byte[] b,
                                 int offset)
public static void shortToArray(short i,
                                byte[] b,
                                int offset)
public static short arrayToShort(byte[] b,
                                 int offset)
public static void InetAddressToArray(java.net.InetAddress inet,
                                      byte[] b,
                                      int offset)
public static java.net.InetAddress arrayToInetAddress(byte[] addr,
                                                      int offset)
public static int getLength(byte[] b,
                            int offset)
public static byte[] stringToArray(java.lang.String s)
public static java.lang.String arrayToString(byte[] b,
                                             int offset)
public static byte[] objectToArray(java.lang.Object s)
public static java.lang.Object arrayToObject(byte[] b,
                                             int offset)
public static java.lang.Object arrayToObject(byte[] b)
public static byte[] messageBytes(Message m)
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||