org.neodatis.odb.core.layers.layer3.engine
Interface IByteArrayConverter

All Superinterfaces:
ITwoPhaseInit
All Known Implementing Classes:
DefaultByteArrayConverter

public interface IByteArrayConverter
extends ITwoPhaseInit


Method Summary
 byte[] bigDecimalToByteArray(java.math.BigDecimal bigDecimal, boolean withSize)
           
 byte[] bigIntegerToByteArray(java.math.BigInteger bigInteger, boolean withSize)
           
 byte[] booleanToByteArray(boolean b)
           
 void booleanToByteArray(boolean b, byte[] arrayWhereToWrite, int offset)
           
 java.math.BigDecimal byteArrayToBigDecimal(byte[] bytes, boolean hasSize)
           
 java.math.BigInteger byteArrayToBigInteger(byte[] bytes, boolean hasSize)
           
 boolean byteArrayToBoolean(byte[] bytes, int offset)
           
 char byteArrayToChar(byte[] bytes)
           
 java.util.Date byteArrayToDate(byte[] bytes)
           
 double byteArrayToDouble(byte[] bytes)
           
 float byteArrayToFloat(byte[] bytes)
           
 int byteArrayToInt(byte[] bytes, int offset)
           
 long byteArrayToLong(byte[] bytes, int offset)
           
 short byteArrayToShort(byte[] bytes)
           
 java.lang.String byteArrayToString(byte[] bytes, boolean hasSize, boolean useEncoding)
           
 byte[] charToByteArray(char c)
           
 byte[] dateToByteArray(java.util.Date date)
           
 byte[] doubleToByteArray(double d)
           
 byte[] floatToByteArray(float f)
           
 int getNumberOfBytesOfAString(java.lang.String s, boolean useEncoding)
           
 byte[] intToByteArray(int l)
           
 void intToByteArray(int l, byte[] arrayWhereToWrite, int offset)
          This method writes the byte directly to the array parameter
 byte[] longToByteArray(long l)
           
 void longToByteArray(long l, byte[] arrayWhereToWrite, int offset)
          This method writes the byte directly to the array parameter
 void setDatabaseCharacterEncoding(java.lang.String databaseCharacterEncoding)
           
 byte[] shortToByteArray(short s)
           
 byte[] stringToByteArray(java.lang.String s, boolean withSize, int totalSpace, boolean withEncoding)
           
 void testEncoding(java.lang.String encoding)
           
 
Methods inherited from interface org.neodatis.odb.core.ITwoPhaseInit
init2
 

Method Detail

booleanToByteArray

byte[] booleanToByteArray(boolean b)

byteArrayToBoolean

boolean byteArrayToBoolean(byte[] bytes,
                           int offset)

shortToByteArray

byte[] shortToByteArray(short s)

byteArrayToShort

short byteArrayToShort(byte[] bytes)

charToByteArray

byte[] charToByteArray(char c)

byteArrayToChar

char byteArrayToChar(byte[] bytes)

getNumberOfBytesOfAString

int getNumberOfBytesOfAString(java.lang.String s,
                              boolean useEncoding)

stringToByteArray

byte[] stringToByteArray(java.lang.String s,
                         boolean withSize,
                         int totalSpace,
                         boolean withEncoding)
Parameters:
s -
withSize - if true, returns an array with an initial int with its size
totalSpace - The total space of the string (can be bigger that the real string size - to support later in place update)
withEncoding - To specify if SPECIFIC encoding must be used
Returns:
The byte array that represent the string

byteArrayToString

java.lang.String byteArrayToString(byte[] bytes,
                                   boolean hasSize,
                                   boolean useEncoding)
Parameters:
bytes -
hasSize - If hasSize is true, the first four bytes are the size of the string
Returns:
The String represented by the byte array
Throws:
java.io.UnsupportedEncodingException

bigDecimalToByteArray

byte[] bigDecimalToByteArray(java.math.BigDecimal bigDecimal,
                             boolean withSize)

byteArrayToBigDecimal

java.math.BigDecimal byteArrayToBigDecimal(byte[] bytes,
                                           boolean hasSize)

bigIntegerToByteArray

byte[] bigIntegerToByteArray(java.math.BigInteger bigInteger,
                             boolean withSize)

byteArrayToBigInteger

java.math.BigInteger byteArrayToBigInteger(byte[] bytes,
                                           boolean hasSize)

intToByteArray

byte[] intToByteArray(int l)

intToByteArray

void intToByteArray(int l,
                    byte[] arrayWhereToWrite,
                    int offset)
This method writes the byte directly to the array parameter


byteArrayToInt

int byteArrayToInt(byte[] bytes,
                   int offset)

longToByteArray

byte[] longToByteArray(long l)

longToByteArray

void longToByteArray(long l,
                     byte[] arrayWhereToWrite,
                     int offset)
This method writes the byte directly to the array parameter


byteArrayToLong

long byteArrayToLong(byte[] bytes,
                     int offset)

dateToByteArray

byte[] dateToByteArray(java.util.Date date)

byteArrayToDate

java.util.Date byteArrayToDate(byte[] bytes)

floatToByteArray

byte[] floatToByteArray(float f)

byteArrayToFloat

float byteArrayToFloat(byte[] bytes)

doubleToByteArray

byte[] doubleToByteArray(double d)

byteArrayToDouble

double byteArrayToDouble(byte[] bytes)

setDatabaseCharacterEncoding

void setDatabaseCharacterEncoding(java.lang.String databaseCharacterEncoding)

booleanToByteArray

void booleanToByteArray(boolean b,
                        byte[] arrayWhereToWrite,
                        int offset)
Parameters:
b -
bytes -
i -

testEncoding

void testEncoding(java.lang.String encoding)
                  throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException