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); }
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(); } }