/** * default constructor */ public SSTRecord() { field_1_num_strings = 0; field_2_num_unique_strings = 0; field_3_strings = new IntMapper <UnicodeString>(); deserializer = new SSTDeserializer(field_3_strings); }
// fix warning CS0169 "never used": int startOfSST, startOfRecord; public SSTSerializer(IntMapper<UnicodeString> strings, int numStrings, int numUniqueStrings) { this.strings = strings; _numStrings = numStrings; _numUniqueStrings = numUniqueStrings; int infoRecs = ExtSSTRecord.GetNumberOfInfoRecsForStrings(strings.Size); this.bucketAbsoluteOffsets = new int[infoRecs]; this.bucketRelativeOffsets = new int[infoRecs]; }
/** * Constructs an SST record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public SSTRecord(RecordInputStream in1) { // this method Is ALWAYS called after construction -- using // the nontrivial constructor, of course -- so this Is where // we initialize our fields field_1_num_strings = in1.ReadInt(); field_2_num_unique_strings = in1.ReadInt(); field_3_strings = new IntMapper <UnicodeString>(); deserializer = new SSTDeserializer(field_3_strings); deserializer.ManufactureStrings(field_2_num_unique_strings, in1); }
// fix warning CS0169 "never used": int startOfSST, startOfRecord; public SSTSerializer(IntMapper <UnicodeString> strings, int numStrings, int numUniqueStrings) { this.strings = strings; _numStrings = numStrings; _numUniqueStrings = numUniqueStrings; int infoRecs = ExtSSTRecord.GetNumberOfInfoRecsForStrings(strings.Size); this.bucketAbsoluteOffsets = new int[infoRecs]; this.bucketRelativeOffsets = new int[infoRecs]; }
public void Use_int_as_discriminator() { var mapper = new IntMapper <BasePaymentModel>( x => x.PaymentNumber) .Register <AchInputModel>(1) .Register <CreditCardInputModel>(2) .Register <PayPalInputModel>(3); var container = RoundTrip( new IntConverter(mapper, _resolver.GetResolvedPropertyName)); CheckPolymorphicModels(container); }
public void TestContinuationWithNoOverlap() { byte[] header = ReadSampleHexData("evencontinuation.txt", "header", FAKE_SID); byte[] continueBytes = ReadSampleHexData("evencontinuation.txt", "continue1", ContinueRecord.sid); RecordInputStream in1 = TestcaseRecordInputStream.Create(Concat(header, continueBytes)); IntMapper strings = new IntMapper(); SSTDeserializer deserializer = new SSTDeserializer(strings); deserializer.ManufactureStrings(2, in1); Assert.AreEqual("At a dinner party or", strings[0] + ""); Assert.AreEqual("At a dinner party", strings[1] + ""); }
public void TestSpanRichTextToPlainText() { byte[] header = ReadSampleHexData("richtextdata.txt", "header", FAKE_SID); byte[] continueBytes = ReadSampleHexData("richtextdata.txt", "continue1", ContinueRecord.sid); RecordInputStream in1 = TestcaseRecordInputStream.Create(Concat(header, continueBytes)); IntMapper strings = new IntMapper(); SSTDeserializer deserializer = new SSTDeserializer(strings); deserializer.ManufactureStrings(1, in1); Assert.AreEqual("At a dinner party orAt At At ", strings[0] + ""); }
public void TestStringAcross2Continuations() { byte[] header = ReadSampleHexData("stringacross2continuations.txt", "header", FAKE_SID); byte[] continue1 = ReadSampleHexData("stringacross2continuations.txt", "continue1", ContinueRecord.sid); byte[] continue2 = ReadSampleHexData("stringacross2continuations.txt", "continue2", ContinueRecord.sid); byte[] bytes = Concat(header, continue1); bytes = Concat(bytes, continue2); RecordInputStream in1 = TestcaseRecordInputStream.Create(bytes); IntMapper strings = new IntMapper(); SSTDeserializer deserializer = new SSTDeserializer(strings); deserializer.ManufactureStrings(2, in1); Assert.AreEqual("At a dinner party or", strings[0] + ""); Assert.AreEqual("At a dinner partyAt a dinner party", strings[1] + ""); }
public void TestExtendedStrings() { byte[] header = ReadSampleHexData("extendedtextstrings.txt", "rich-header", FAKE_SID); byte[] continueBytes = ReadSampleHexData("extendedtextstrings.txt", "rich-continue1", ContinueRecord.sid); RecordInputStream in1 = TestcaseRecordInputStream.Create(Concat(header, continueBytes)); IntMapper strings = new IntMapper(); SSTDeserializer deserializer = new SSTDeserializer(strings); deserializer.ManufactureStrings(1, in1); Assert.AreEqual("At a dinner party orAt At At ", strings[0].ToString()); header = ReadSampleHexData("extendedtextstrings.txt", "norich-header", FAKE_SID); continueBytes = ReadSampleHexData("extendedtextstrings.txt", "norich-continue1", ContinueRecord.sid); in1 = TestcaseRecordInputStream.Create(Concat(header, continueBytes)); strings = new IntMapper(); deserializer = new SSTDeserializer(strings); deserializer.ManufactureStrings(1, in1); Assert.AreEqual("At a dinner party orAt At At ", strings[0] + ""); }
private static UnicodeString GetUnicodeString(IntMapper<UnicodeString> strings, int index) { return (UnicodeString)strings[index]; }
/** * Constructs an SST record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public SSTRecord(RecordInputStream in1) { // this method Is ALWAYS called after construction -- using // the nontrivial constructor, of course -- so this Is where // we initialize our fields field_1_num_strings = in1.ReadInt(); field_2_num_unique_strings = in1.ReadInt(); field_3_strings = new IntMapper<UnicodeString>(); deserializer = new SSTDeserializer(field_3_strings); deserializer.ManufactureStrings(field_2_num_unique_strings, in1); }
/** * default constructor */ public SSTRecord() { field_1_num_strings = 0; field_2_num_unique_strings = 0; field_3_strings = new IntMapper<UnicodeString>(); deserializer = new SSTDeserializer(field_3_strings); }
public SSTDeserializer(IntMapper <UnicodeString> strings) { this.strings = strings; }
public SSTDeserializer(IntMapper<UnicodeString> strings) { this.strings = strings; }
public void SetUp() { strings = new IntMapper(); }
private static UnicodeString GetUnicodeString(IntMapper <UnicodeString> strings, int index) { return((UnicodeString)strings[index]); }
static public void AddToStringTable(IntMapper<UnicodeString> strings, UnicodeString str) { strings.Add(str); }
static public void AddToStringTable(IntMapper <UnicodeString> strings, UnicodeString str) { strings.Add(str); }
public SSTDeserializer(IntMapper strings) { this.strings = strings; }