Exemplo n.º 1
0
        static internal char[] Read(RuleBasedCollator rbc, IBM.ICU.Text.RuleBasedCollator.UCAConstants ucac)
        {
            Stream i = IBM.ICU.Impl.ICUData.GetRequiredStream(
                IBM.ICU.Impl.ICUResourceBundle.ICU_BASE_NAME /* +
                                                              * IBM.ICU.Impl.ICUResourceBundle.ICU_BUNDLE */
                + "/ucadata.icu");
            BufferedStream b      = new BufferedStream(i, 90000);
            CollatorReader reader = new CollatorReader(b);

            char[] result = reader.ReadImp(rbc, ucac);
            b.Close();
            return(result);
        }
Exemplo n.º 2
0
        static internal IBM.ICU.Text.CollationParsedRuleBuilder.InverseUCA  GetInverseUCA()
        {
            IBM.ICU.Text.CollationParsedRuleBuilder.InverseUCA result = null;
            Stream i = IBM.ICU.Impl.ICUData.GetRequiredStream(IBM.ICU.Impl.ICUResourceBundle.ICU_BASE_NAME
                                                              + "/invuca.icu");
            // try {
            // String invdat = "/com/ibm/icu/impl/data/invuca.icu";
            // InputStream i =
            // CollationParsedRuleBuilder.class.getResourceAsStream(invdat);
            BufferedStream b = new BufferedStream(i, 110000);

            result = CollatorReader.ReadInverseUCA(b);
            b.Close();
            i.Close();
            return(result);
            // } catch (Exception e) {
            // throw new RuntimeException(e.getMessage());
            // }
        }
Exemplo n.º 3
0
        static internal void InitRBC(RuleBasedCollator rbc, byte[] data)
        {
            int MIN_BINARY_DATA_SIZE_ = (42 + 25) << 2;

            Stream         i      = new MemoryStream(data);
            BufferedStream b      = new BufferedStream(i);
            CollatorReader reader = new CollatorReader(b, false);

            if (data.Length > MIN_BINARY_DATA_SIZE_)
            {
                reader.ReadImp(rbc, null);
            }
            else
            {
                reader.ReadHeader(rbc);
                reader.ReadOptions(rbc);
                // duplicating UCA_'s data
                rbc.SetWithUCATables();
            }
        }