public class Conversion extends 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(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 String |
convertToString(byte[] buf)
Convert a byte array (encoded as UTF-8) into a String
|
static void |
main(String[] args)
Test static methods
|
public static byte[] convertToByteArray(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 String convertToString(byte[] buf)
public static int convertToInt(byte[] buf)
public static long convertToLong(byte[] buf)
public static void main(String[] args)
Copyright © 2003-2013 Apache Software Foundation. All Rights Reserved.