本文整理汇总了C#中IBinaryReader.GetRawReader方法的典型用法代码示例。如果您正苦于以下问题:C# IBinaryReader.GetRawReader方法的具体用法?C# IBinaryReader.GetRawReader怎么用?C# IBinaryReader.GetRawReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBinaryReader
的用法示例。
在下文中一共展示了IBinaryReader.GetRawReader方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComputeFuncJob
/// <summary>
/// Initializes a new instance of the <see cref="ComputeFuncJob"/> class.
/// </summary>
/// <param name="reader">The reader.</param>
public ComputeFuncJob(IBinaryReader reader)
{
var reader0 = (BinaryReader) reader.GetRawReader();
_clo = reader0.ReadObject<IComputeFunc>();
_arg = reader0.ReadObject<object>();
}
示例2: ContinuousQueryFilterHolder
/// <summary>
/// Initializes a new instance of the <see cref="ContinuousQueryFilterHolder"/> class.
/// </summary>
/// <param name="reader">The reader.</param>
public ContinuousQueryFilterHolder(IBinaryReader reader)
{
var rawReader = (BinaryReader) reader.GetRawReader();
_filter = rawReader.ReadObject<object>();
_keepBinary = rawReader.ReadBoolean();
}
示例3: SerializableObjectHolder
/// <summary>
/// Initializes a new instance of the <see cref="SerializableObjectHolder"/> class.
/// </summary>
/// <param name="reader">The reader.</param>
public SerializableObjectHolder(IBinaryReader reader)
{
Debug.Assert(reader != null);
var reader0 = (BinaryReader) reader.GetRawReader();
_item = new BinaryFormatter().Deserialize(new BinaryStreamAdapter(reader0.Stream), null);
}
示例4: ComputeJobHolder
/// <summary>
/// Default ctor for marshalling.
/// </summary>
/// <param name="reader"></param>
public ComputeJobHolder(IBinaryReader reader)
{
Debug.Assert(reader != null);
var reader0 = (BinaryReader) reader.GetRawReader();
_ignite = reader0.Marshaller.Ignite;
_job = reader0.ReadObject<IComputeJob>();
}
示例5: ReadBinary
/** <inheritDoc /> */
public void ReadBinary(IBinaryReader reader)
{
A = reader.ReadInt("a");
B = reader.GetRawReader().ReadInt();
}
示例6: ReadBinary
public void ReadBinary(IBinaryReader reader)
{
Assert.AreEqual(1, reader.ReadByte("Byte"));
Assert.AreEqual(new byte[] {1}, reader.ReadByteArray("ByteArray"));
Assert.AreEqual('1', reader.ReadChar("Char"));
Assert.AreEqual(new[] {'1'}, reader.ReadCharArray("CharArray"));
Assert.AreEqual(1, reader.ReadShort("Short"));
Assert.AreEqual(new short[] {1}, reader.ReadShortArray("ShortArray"));
Assert.AreEqual(1, reader.ReadInt("Int"));
Assert.AreEqual(new[] {1}, reader.ReadIntArray("IntArray"));
Assert.AreEqual(1, reader.ReadLong("Long"));
Assert.AreEqual(new long[] {1}, reader.ReadLongArray("LongArray"));
Assert.AreEqual(true, reader.ReadBoolean("Boolean"));
Assert.AreEqual(new[] {true}, reader.ReadBooleanArray("BooleanArray"));
Assert.AreEqual(1, reader.ReadFloat("Float"));
Assert.AreEqual(new float[] {1}, reader.ReadFloatArray("FloatArray"));
Assert.AreEqual(1, reader.ReadDouble("Double"));
Assert.AreEqual(new double[] {1}, reader.ReadDoubleArray("DoubleArray"));
Assert.AreEqual(1, reader.ReadDecimal("Decimal"));
Assert.AreEqual(new decimal?[] {1}, reader.ReadDecimalArray("DecimalArray"));
Assert.AreEqual(Date, reader.ReadTimestamp("Timestamp"));
Assert.AreEqual(new DateTime?[] {Date}, reader.ReadTimestampArray("TimestampArray"));
Assert.AreEqual("1", reader.ReadString("String"));
Assert.AreEqual(new[] {"1"}, reader.ReadStringArray("StringArray"));
Assert.AreEqual(Guid, reader.ReadGuid("Guid"));
Assert.AreEqual(new Guid?[] {Guid}, reader.ReadGuidArray("GuidArray"));
Assert.AreEqual(MyEnum.Bar, reader.ReadEnum<MyEnum>("Enum"));
Assert.AreEqual(new[] {MyEnum.Bar}, reader.ReadEnumArray<MyEnum>("EnumArray"));
var raw = reader.GetRawReader();
Assert.AreEqual(1, raw.ReadByte());
Assert.AreEqual(new byte[] { 1 }, raw.ReadByteArray());
Assert.AreEqual('1', raw.ReadChar());
Assert.AreEqual(new[] { '1' }, raw.ReadCharArray());
Assert.AreEqual(1, raw.ReadShort());
Assert.AreEqual(new short[] { 1 }, raw.ReadShortArray());
Assert.AreEqual(1, raw.ReadInt());
Assert.AreEqual(new[] { 1 }, raw.ReadIntArray());
Assert.AreEqual(1, raw.ReadLong());
Assert.AreEqual(new long[] { 1 }, raw.ReadLongArray());
Assert.AreEqual(true, raw.ReadBoolean());
Assert.AreEqual(new[] { true }, raw.ReadBooleanArray());
Assert.AreEqual(1, raw.ReadFloat());
Assert.AreEqual(new float[] { 1 }, raw.ReadFloatArray());
Assert.AreEqual(1, raw.ReadDouble());
Assert.AreEqual(new double[] { 1 }, raw.ReadDoubleArray());
Assert.AreEqual(1, raw.ReadDecimal());
Assert.AreEqual(new decimal?[] { 1 }, raw.ReadDecimalArray());
Assert.AreEqual(Date, raw.ReadTimestamp());
Assert.AreEqual(new DateTime?[] { Date }, raw.ReadTimestampArray());
Assert.AreEqual("1", raw.ReadString());
Assert.AreEqual(new[] { "1" }, raw.ReadStringArray());
Assert.AreEqual(Guid, raw.ReadGuid());
Assert.AreEqual(new Guid?[] { Guid }, raw.ReadGuidArray());
Assert.AreEqual(MyEnum.Bar, raw.ReadEnum<MyEnum>());
Assert.AreEqual(new[] { MyEnum.Bar }, raw.ReadEnumArray<MyEnum>());
}
示例7: CacheEntryProcessorHolder
/// <summary>
/// Initializes a new instance of the <see cref="CacheEntryProcessorHolder"/> class.
/// </summary>
/// <param name="reader">The reader.</param>
public CacheEntryProcessorHolder(IBinaryReader reader)
{
var reader0 = (BinaryReader) reader.GetRawReader();
_proc = reader0.ReadObject<object>();
_arg = reader0.ReadObject<object>();
_processFunc = GetProcessFunc(_proc);
var kvTypes = DelegateTypeDescriptor.GetCacheEntryProcessorTypes(_proc.GetType());
_entryCtor = MutableCacheEntry.GetCtor(kvTypes.Item1, kvTypes.Item2);
}
示例8: DateTimeHolder
/// <summary>
/// Constructor.
/// </summary>
/// <param name="reader">The reader.</param>
public DateTimeHolder(IBinaryReader reader)
{
Debug.Assert(reader != null);
_item = DateTime.FromBinary(reader.GetRawReader().ReadLong());
}
示例9: ComputeActionJob
/// <summary>
/// Initializes a new instance of the <see cref="ComputeActionJob"/> class.
/// </summary>
/// <param name="reader">The reader.</param>
public ComputeActionJob(IBinaryReader reader)
{
var reader0 = (BinaryReader)reader.GetRawReader();
_action = reader0.ReadObject<IComputeAction>();
}
示例10: CacheEntryFilterHolder
/// <summary>
/// Initializes a new instance of the <see cref="CacheEntryFilterHolder"/> class.
/// </summary>
/// <param name="reader">The reader.</param>
public CacheEntryFilterHolder(IBinaryReader reader)
{
var reader0 = (BinaryReader)reader.GetRawReader();
_pred = reader0.ReadObject<object>();
_keepBinary = reader0.ReadBoolean();
_marsh = reader0.Marshaller;
_invoker = GetInvoker(_pred);
}