Class StringResources


  • public class StringResources
    extends Object
    Represents string resources of types string, plural and array for a locale. Also responsible for generating a custom format binary file for the resources.
    • Method Detail

      • getBinaryFileContent

        public byte[] getBinaryFileContent()
        Returns a byte array that represents the entire set of strings, plurals and string arrays in the following binary file format:

           [Int: Version]
        
           [Int: # of strings]
           [Int: Smallest resource id among strings]
           [[Short: resource id delta] [Byte: #genders] [[Byte: gender enum ordinal] [Short: length of
            the string]] x #genders] x # of strings
           [Byte array of the string value] x # summation of genders over # of strings
        
           [Int: # of plurals]
           [Int: Smallest resource id among plurals]
           [[Short: resource id delta] [Byte: #genders] [[Byte: gender enum ordinal] [Byte: #categories]
            [[Byte: category] [Short: length of plural value]] x #categories] x # of genders]
            x # of plurals
           [Byte array of plural value] x Summation of genders over plural categories over # of plurals
        
           [Int: # of arrays]
           [Int: Smallest resource id among arrays]
           [[Short: resource id delta] [Byte: #genders] [[Byte: gender enum ordinal] [Int: #elements]
            [Short: length of element] x # phaof elements] x # of genders] x # of arrays
           [Byte array of string value] x Summation of genders over array elements over # of arrays