Class FormatIdUtil
java.lang.Object
org.apache.derby.iapi.services.io.FormatIdUtil
Utility class with static methods for constructing and reading the byte array
representation of format id's.
This utility supports a number of families of format ids. The byte array form of each family is a different length. In all cases the first two bits of the first byte indicate the family for an id. The list below describes each family and gives its two bit identifier in parens.
- (0) - The format id is a one byte number between 0 and 63 inclusive. The byte[] encoding fits in one byte.
- (1) - The format id is a two byte number between 16384 to 32767 inclusive. The byte[] encoding stores the high order byte first.
- (2) - The format id is four byte number between 2147483648 and 3221225471 inclusive. The byte[] encoding stores the high order byte first.
- (3) - Future expansion.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatIdToString
(int fmtId) static int
getFormatIdByteLength
(int formatId) static int
readFormatIdInteger
(byte[] data) static int
static void
writeFormatIdInteger
(DataOutput out, int formatId)
-
Constructor Details
-
FormatIdUtil
private FormatIdUtil()
-
-
Method Details
-
getFormatIdByteLength
public static int getFormatIdByteLength(int formatId) -
writeFormatIdInteger
- Throws:
IOException
-
readFormatIdInteger
- Throws:
IOException
-
readFormatIdInteger
public static int readFormatIdInteger(byte[] data) -
formatIdToString
-