| java.lang.Object jdbm.helper.Conversion
Conversion | public class Conversion (Code) | | Miscelaneous conversion utility methods.
author: Alex Boisvert version: $Id: Conversion.java,v 1.3 2002/05/31 06:33:20 boisvert Exp $ |
Method Summary | |
public static byte[] | convertToByteArray(String s) Convert a string into a byte array. | public static byte[] | convertToByteArray(byte n) Convert a byte into a byte array. | public static byte[] | convertToByteArray(short n) Convert a short into a byte array. | public static byte[] | convertToByteArray(int n) Convert an int into a byte array. | public static byte[] | convertToByteArray(long n) Convert a long into a byte array. | public static int | convertToInt(byte[] buf) Convert a byte array into an integer (signed 32-bit) value. | public static long | convertToLong(byte[] buf) Convert a byte array into a long (signed 64-bit) value. | public static String | convertToString(byte[] buf) | public static void | main(String[] args) | final static void | pack2(byte[] data, int offs, int val) | final static void | pack4(byte[] data, int offs, int val) | final static void | pack8(byte[] data, int offs, long val) | static int | unpack4(byte[] buf, int offset) |
convertToByteArray | public static byte[] convertToByteArray(String s)(Code) | | Convert a string into a byte array.
|
convertToByteArray | public static byte[] convertToByteArray(byte n)(Code) | | Convert a byte into a byte array.
|
convertToByteArray | public static byte[] convertToByteArray(short n)(Code) | | Convert a short into a byte array.
|
convertToByteArray | public static byte[] convertToByteArray(int n)(Code) | | Convert an int into a byte array.
|
convertToByteArray | public static byte[] convertToByteArray(long n)(Code) | | Convert a long into a byte array.
|
convertToInt | public static int convertToInt(byte[] buf)(Code) | | Convert a byte array into an integer (signed 32-bit) value.
|
convertToLong | public static long convertToLong(byte[] buf)(Code) | | Convert a byte array into a long (signed 64-bit) value.
|
convertToString | public static String convertToString(byte[] buf)(Code) | | Convert a byte array (encoded as UTF-8) into a String
|
main | public static void main(String[] args)(Code) | | Test static methods
|
pack2 | final static void pack2(byte[] data, int offs, int val)(Code) | | |
pack4 | final static void pack4(byte[] data, int offs, int val)(Code) | | |
pack8 | final static void pack8(byte[] data, int offs, long val)(Code) | | |
unpack4 | static int unpack4(byte[] buf, int offset)(Code) | | |
|
|