public void Struct_OneBlob() { var data = DirStructure.OwnTestFileAsBytes("binary/struct_oneblob.bindat"); var reader = new UserBinaryReader(new MemoryStream(data)); ReaderTestCommon.Struct_OneBlob(reader); }
public void Combined1() { var data = DirStructure.OwnTestFileAsBytes("binary/combined1.bindat"); var reader = new UserBinaryReader(new MemoryStream(data)); ReaderTestCommon.Combined1(reader); }
public void Empty() { var bytes = new byte[0]; var reader = new UserBinaryReader(new MemoryStream(bytes)); ReaderTestCommon.Empty(reader); }
public void SingleIntList() { var data = DirStructure.OwnTestFileAsBytes("binary/single_int_list.bindat"); var reader = new UserBinaryReader(new MemoryStream(data)); ReaderTestCommon.SingleIntList(reader); }
public void TwoLayer_TestStepout_Skip() { const string fileName = "binary/twolayer.bindat"; var data = DirStructure.OwnTestFileAsBytes(fileName); var reader = new UserBinaryReader(new MemoryStream(data)); ReaderTestCommon.TwoLayer_TestStepoutSkip(reader); }
public void TrivialStruct() { //empty struct {} var trivial = DirStructure.OwnTestFileAsBytes("binary/trivial.bindat"); var reader = new UserBinaryReader(new MemoryStream(trivial)); ReaderTestCommon.TrivialStruct(reader); }
public void OneBoolInStruct() { //simple datagram: {yolo:true} var oneBool = DirStructure.OwnTestFileAsBytes("binary/onebool.bindat"); var reader = new UserBinaryReader(new MemoryStream(oneBool)); ReaderTestCommon.OneBoolInStruct(reader); }
public void ReadAnnotations_SingleField() { // a singlefield structure with annotations // {withannot:years::months::days::hours::minutes::seconds::18} var annotSingleField = DirStructure.OwnTestFileAsBytes("binary/annot_singlefield.bindat"); var reader = new UserBinaryReader(new MemoryStream(annotSingleField)); ReaderTestCommon.ReadAnnotations_SingleField(reader); }
public void FlatIntList() { //a flat list of ints [123,456,789] var flatListInt = DirStructure.OwnTestFileAsBytes("binary/flatlist_int.bindat"); var reader = new UserBinaryReader(new MemoryStream(flatListInt)); ReaderTestCommon.FlatIntList(reader); }
public void FlatIntList() { //a flat list of ints [123,456,789] var flatListInt = DirStructure.ReadDataFile("text/flatlist_int.ion"); var reader = new UserTextReader(new MemoryStream(flatListInt)); ReaderTestCommon.FlatIntList(reader); }
public void Combined1() { var data = DirStructure.OwnTestFileAsBytes("text/combined1.ion"); var reader = new UserTextReader(new MemoryStream(data)); ReaderTestCommon.Combined1(reader); reader = new UserTextReader(Encoding.UTF8.GetString(data)); ReaderTestCommon.Combined1(reader); }
public void SingleIntList() { var data = DirStructure.OwnTestFileAsBytes("text/single_int_list.ion"); var reader = new UserTextReader(new MemoryStream(data)); ReaderTestCommon.SingleIntList(reader); reader = new UserTextReader(Encoding.UTF8.GetString(data)); ReaderTestCommon.SingleIntList(reader); }
public void SingleSymbol() { //struct with single symbol //{single_symbol:'something'} var data = DirStructure.OwnTestFileAsBytes("binary/single_symbol.bindat"); var reader = new UserBinaryReader(new MemoryStream(data)); ReaderTestCommon.SingleSymbol(reader); }
public void Struct_OneBlob() { var data = DirStructure.OwnTestFileAsBytes("text/struct_oneblob.ion"); var reader = new UserTextReader(new MemoryStream(data)); ReaderTestCommon.Struct_OneBlob(reader); reader = new UserTextReader(Encoding.UTF8.GetString(data)); ReaderTestCommon.Struct_OneBlob(reader); }
public void ReadAnnotations_SingleField() { // a singlefield structure with annotations // {withannot:years::months::days::hours::minutes::seconds::18} var annotSingleField = DirStructure.ReadDataFile("binary/annot_singlefield.bindat"); var converter = new SaveAnnotationsReaderRoutine(); var reader = new UserBinaryReader(new MemoryStream(annotSingleField), converter); ReaderTestCommon.ReadAnnotations_SingleField(reader, converter); }
public void SingleNumber(string text, long value) { var bin = Encoding.UTF8.GetBytes(text); var reader = new UserTextReader(new MemoryStream(bin)); ReaderTestCommon.SingleNumber(reader, value); reader = new UserTextReader(text); ReaderTestCommon.SingleNumber(reader, value); }
public void OneBoolInStruct() { //simple datagram: {yolo:true} var oneBool = DirStructure.OwnTestFileAsBytes("text/onebool.ion"); var reader = new UserTextReader(new MemoryStream(oneBool)); ReaderTestCommon.OneBoolInStruct(reader); reader = new UserTextReader(Encoding.UTF8.GetString(oneBool)); ReaderTestCommon.OneBoolInStruct(reader); }
public void SingleSymbol() { //struct with single symbol //{single_symbol:'something'} var data = DirStructure.OwnTestFileAsBytes("text/single_symbol.ion"); var reader = new UserTextReader(new MemoryStream(data)); ReaderTestCommon.SingleSymbol(reader); reader = new UserTextReader(Encoding.UTF8.GetString(data)); ReaderTestCommon.SingleSymbol(reader); }
public void TrivialStruct() { //empty struct {} var trivial = DirStructure.OwnTestFileAsBytes("text/trivial.ion"); var text = Encoding.UTF8.GetString(trivial); var reader = new UserTextReader(text); ReaderTestCommon.TrivialStruct(reader); reader = new UserTextReader(new MemoryStream(trivial)); ReaderTestCommon.TrivialStruct(reader); }
public void Blob_PartialRead(int size, int step) { var blob = new byte[size]; for (var i = 0; i < size; i++) { blob[i] = (byte)i; } var text = "{{" + Convert.ToBase64String(blob) + "}}"; var reader = new UserTextReader(text); ReaderTestCommon.Blob_PartialRead(size, step, reader); }
public void FlatScalar() { //a flat struct of scalar values: //boolean:true //str:"yes" //integer:123456 //longInt:int.Max*2 //bigInt:long.Max*10 //double:2213.1267567f var flatScalar = DirStructure.OwnTestFileAsBytes("binary/flat_scalar.bindat"); var reader = new UserBinaryReader(new MemoryStream(flatScalar)); ReaderTestCommon.FlatScalar(reader); }
public void FlatScalar() { //a flat struct of scalar values: //boolean:true //str:"yes" //integer:123456 //longInt:int.Max*2 //bigInt:long.Max*10 //double:2213.1267567f var flatScalar = DirStructure.OwnTestFileAsBytes("text/flat_scalar.ion"); var reader = new UserTextReader(new MemoryStream(flatScalar)); ReaderTestCommon.FlatScalar(reader); reader = new UserTextReader(Encoding.UTF8.GetString(flatScalar)); ReaderTestCommon.FlatScalar(reader); }
public void Blob_PartialRead(int size, int step) { var blob = new byte[size]; for (var i = 0; i < size; i++) { blob[i] = (byte)i; } var memStream = new MemoryStream(); using (var writer = IonBinaryWriterBuilder.Build(memStream)) { writer.WriteBlob(blob); writer.Finish(); } var output = memStream.ToArray(); var reader = IonReaderBuilder.Build(new MemoryStream(output)); ReaderTestCommon.Blob_PartialRead(size, step, reader); }
public void SingleNumber(byte[] data, long value) { IIonReader reader = new UserBinaryReader(new MemoryStream(data)); ReaderTestCommon.SingleNumber(reader, value); }
public void SingleBool(byte[] data, bool value) { var reader = new UserBinaryReader(new MemoryStream(data)); ReaderTestCommon.SingleBool(reader, value); }