Class FormatIdUtil

java.lang.Object
org.apache.derby.iapi.services.io.FormatIdUtil

public final class FormatIdUtil extends Object
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 Details

    • FormatIdUtil

      private FormatIdUtil()
  • Method Details

    • getFormatIdByteLength

      public static int getFormatIdByteLength(int formatId)
    • writeFormatIdInteger

      public static void writeFormatIdInteger(DataOutput out, int formatId) throws IOException
      Throws:
      IOException
    • readFormatIdInteger

      public static int readFormatIdInteger(DataInput in) throws IOException
      Throws:
      IOException
    • readFormatIdInteger

      public static int readFormatIdInteger(byte[] data)
    • formatIdToString

      public static String formatIdToString(int fmtId)