Class FormatIdUtil


  • public final class FormatIdUtil
    extends java.lang.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 Detail

      • FormatIdUtil

        private FormatIdUtil()
    • Method Detail

      • getFormatIdByteLength

        public static int getFormatIdByteLength​(int formatId)
      • writeFormatIdInteger

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

        public static int readFormatIdInteger​(java.io.DataInput in)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readFormatIdInteger

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

        public static java.lang.String formatIdToString​(int fmtId)