DbStorage
Class DataConvertion

java.lang.Object
  extended byDbStorage.DataConvertion

public class DataConvertion
extends java.lang.Object

This class is used to convert some data types to their representation as a byte array or viceversa.


Constructor Summary
DataConvertion()
           
 
Method Summary
static double bytesToDouble(byte[] value)
          Converts a double floating point number to a byte array.
static long bytesToLong(byte[] value)
          Converts a byte array to a long integer.
static java.lang.String bytesToString(byte[] value)
          Converts a byte array to a String.
static byte[] doubleToBytes(double value)
          Converts a double floating point number to a byte array.
static byte[] longToBytes(long value)
          Converts a long integer to a byte array.
static byte[] stringToBytes(java.lang.String value)
          Converts a String to a byte array.
static byte[] stringToBytes(java.lang.String value, int off, int len)
          Converts a String to a byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataConvertion

public DataConvertion()
Method Detail

longToBytes

public static byte[] longToBytes(long value)
Converts a long integer to a byte array.


bytesToLong

public static long bytesToLong(byte[] value)
Converts a byte array to a long integer.


doubleToBytes

public static byte[] doubleToBytes(double value)
Converts a double floating point number to a byte array.


bytesToDouble

public static double bytesToDouble(byte[] value)
Converts a double floating point number to a byte array.


stringToBytes

public static byte[] stringToBytes(java.lang.String value)
Converts a String to a byte array.


stringToBytes

public static byte[] stringToBytes(java.lang.String value,
                                   int off,
                                   int len)
Converts a String to a byte array.


bytesToString

public static java.lang.String bytesToString(byte[] value)
Converts a byte array to a String.