iitb.con.util
Class BytesConverter

java.lang.Object
  extended by iitb.con.util.BytesConverter

public class BytesConverter
extends java.lang.Object

ByteConverter converts primitive data type to bytes.
The byte order is consider as BIG_ENDIAN


Constructor Summary
BytesConverter()
           
 
Method Summary
static byte[] getBytes(java.util.Date value)
          Returns Date value as bytes
static byte[] getBytes(double value)
          Returns double value as bytes
static byte[] getBytes(float value)
          Returns float value as bytes
static byte[] getBytes(int value)
          Returns int value as bytes
static byte[] getBytes(long value)
          Returns long value as bytes
static byte[] getBytes(short value)
          Returns short value as bytes
static byte[] getBytes(java.lang.String value)
          Returns String value as bytes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BytesConverter

public BytesConverter()
Method Detail

getBytes

public static byte[] getBytes(java.util.Date value)
Returns Date value as bytes

Returns:
value as byte array

getBytes

public static byte[] getBytes(double value)
Returns double value as bytes

Returns:
value as byte array

getBytes

public static byte[] getBytes(float value)
Returns float value as bytes

Returns:
value as byte array

getBytes

public static byte[] getBytes(int value)
Returns int value as bytes

Returns:
value as byte array

getBytes

public static byte[] getBytes(long value)
Returns long value as bytes

Returns:
value as byte array

getBytes

public static byte[] getBytes(short value)
Returns short value as bytes

Returns:
value as byte array

getBytes

public static byte[] getBytes(java.lang.String value)
Returns String value as bytes

Returns:
value as byte array