public class Conversion
extends java.lang.Object
Constructor and Description |
---|
Conversion() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
convertToByteArray(byte n)
Convert a byte into a byte array.
|
static byte[] |
convertToByteArray(int n)
Convert an int into a byte array.
|
static byte[] |
convertToByteArray(long n)
Convert a long into a byte array.
|
static byte[] |
convertToByteArray(short n)
Convert a short into a byte array.
|
static byte[] |
convertToByteArray(java.lang.String s)
Convert a string into a byte array.
|
static int |
convertToInt(byte[] buf)
Convert a byte array into an integer (signed 32-bit) value.
|
static long |
convertToLong(byte[] buf)
Convert a byte array into a long (signed 64-bit) value.
|
static java.lang.String |
convertToString(byte[] buf)
Convert a byte array (encoded as UTF-8) into a String
|
static void |
main(java.lang.String[] args)
Test static methods
|
(package private) static void |
pack2(byte[] data,
int offs,
int val) |
(package private) static void |
pack4(byte[] data,
int offs,
int val) |
(package private) static void |
pack8(byte[] data,
int offs,
long val) |
(package private) static int |
unpack4(byte[] buf,
int offset) |
public static byte[] convertToByteArray(java.lang.String s)
public static byte[] convertToByteArray(byte n)
public static byte[] convertToByteArray(short n)
public static byte[] convertToByteArray(int n)
public static byte[] convertToByteArray(long n)
public static java.lang.String convertToString(byte[] buf)
public static int convertToInt(byte[] buf)
public static long convertToLong(byte[] buf)
static int unpack4(byte[] buf, int offset)
static final void pack2(byte[] data, int offs, int val)
static final void pack4(byte[] data, int offs, int val)
static final void pack8(byte[] data, int offs, long val)
public static void main(java.lang.String[] args)
Cees de Groot (C) 2000-2001. All rights reserved http://jdbm.sourceforge.net