ca.mint.mintchip.core

Interface IConverter


public interface IConverter

This interface represents a converter for specific data types used by MintChip.

Methods
Modifier and Type Method and Description
byte[] convert2ByteInt(int value)
Converts 2 bytes of the int value to a byte array.
byte[] convert3ByteInt(int value)
Converts 3 bytes of the int value to a byte array.
byte[] convertBoolean(boolean value)
Converts a boolean value to a one element byte array.
byte[] convertCalendar(java.util.Calendar calendar)
Converts the date and time to a 3-byte MintChip format
byte[] convertInt(int value)
Converts an int value to a byte array.
byte[] convertMintChipId(java.lang.String id)
Converts the MintChip Id to a byte array.
int to2ByteInt(byte[] data, int offset)
Converts a 2 byte array to an int.
int to3ByteInt(byte[] data, int offset)
Converts a 3 byte array to an int.
boolean toBoolean(byte[] data, int offset)
Converts a byte to a boolean.
java.util.Calendar toCalendar(byte[] data, int offset)
Converts a byte array to the Calendar.
int toInt(byte[] data, int offset)
Converts a byte array to an int.
java.lang.String toMintChipId(byte[] data, int offset)
Converts a byte array to the MintChip Id.
java.lang.String toMintChipVersion(byte[] data, int offset)
Converts a byte array to the MintChip version.
Method Detail

toMintChipId

java.lang.String toMintChipId(byte[] data, int offset) throws java.io.IOException

Converts a byte array to the MintChip Id.

Parameters:
data - byte array to convert
offset - zero based start position in the data array
Returns:
a string containing the MintChip Id
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

convertMintChipId

byte[] convertMintChipId(java.lang.String id)

Converts the MintChip Id to a byte array.

Parameters:
id - the MintChip Id to convert
Returns:
a byte array

toMintChipVersion

java.lang.String toMintChipVersion(byte[] data, int offset)

Converts a byte array to the MintChip version.

Parameters:
data - byte array to convert
offset - zero based start position in the data array
Returns:
a string containing the MintChip version

toCalendar

java.util.Calendar toCalendar(byte[] data, int offset) throws java.io.IOException

Converts a byte array to the Calendar.

Parameters:
data - byte array to convert
offset - zero based start position in the data array
Returns:
a Calendar object containing the date and time
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

convertCalendar

byte[] convertCalendar(java.util.Calendar calendar)

Converts the date and time to a 3-byte MintChip format.

Parameters:
calendar - the date and time to convert
Returns:
a byte array

toBoolean

boolean toBoolean(byte[] data, int offset)

Converts a byte to a boolean.

Parameters:
data - byte array to convert
offset - zero based start position in the data array
Returns:
boolean value converted from the data array at the offset position

convertBoolean

byte[] convertBoolean(boolean value)

Converts a boolean value to a one element byte array.

Parameters:
value - the value to convert
Returns:
a one element byte array

toInt

int toInt(byte[] data, int offset)

Converts a byte array to an int.

Parameters:
data - byte array to convert
offset - zero based start position in the data array
Returns:
int value converted from the data array

convertInt

byte[] convertInt(int value)

Converts an int value to a byte array.

Parameters:
value - the value to convert
Returns:
a byte array

to3ByteInt

int to3ByteInt(byte[] data, int offset)

Converts a 3 byte array to an int.

Parameters:
data - byte array to convert
offset - zero based start position in the data array
Returns:
int value converted from the data array

convert3ByteInt

byte[] convert3ByteInt(int value)

Converts 3 bytes of the int value to a byte array.

Parameters:
value - the value to convert
Returns:
a byte array

to2ByteInt

int to2ByteInt(byte[] data, int offset)

Converts a 2 byte array to an int.

Parameters:
data - byte array to convert
offset - zero based start position in the data array
Returns:
int value converted from the data array

convert2ByteInt

byte[] convert2ByteInt(int value)

Converts 2 bytes of the int value to a byte array.

Parameters:
value - the value to convert
Returns:
a byte array