本文整理汇总了C#中IBinaryReader类的典型用法代码示例。如果您正苦于以下问题:C# IBinaryReader类的具体用法?C# IBinaryReader怎么用?C# IBinaryReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IBinaryReader类属于命名空间,在下文中一共展示了IBinaryReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Decompress
protected static byte[] Decompress(byte[] decrypted, IBinaryReader reader, byte[] key, int keyMod) {
int destIndex = 0;
while (reader.Position < reader.Length) {
if (destIndex >= decrypted.Length)
break;
byte flags = reader.ReadByte();
for (int mask = 1; mask != 0x100; mask <<= 1) {
if (reader.Position >= reader.Length)
break;
if (destIndex >= decrypted.Length)
break;
if ((flags & mask) != 0) {
int displ = (int)reader.Read7BitEncodedUInt32();
int size = (int)reader.Read7BitEncodedUInt32();
Copy(decrypted, destIndex - displ, decrypted, destIndex, size);
destIndex += size;
}
else {
byte b = reader.ReadByte();
if (key != null)
b ^= key[destIndex % keyMod];
decrypted[destIndex++] = b;
}
}
}
return decrypted;
}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:28,代码来源:StaticMethodsDecrypter.cs
示例2: ReadBinary
/** <inheritDoc /> */
public void ReadBinary(IBinaryReader reader)
{
StreetNumber = reader.ReadInt("streetNum");
FlatNumber = reader.ReadInt("flatNum");
City = reader.ReadString("city");
Street = reader.ReadString("street");
}
开发者ID:RazmikMkrtchyan,项目名称:ignite,代码行数:8,代码来源:Address.cs
示例3: ReadBinary
/** <inheritDoc /> */
public void ReadBinary(IBinaryReader reader)
{
Byte = reader.ReadByte("Byte");
ByteArray = reader.ReadByteArray("ByteArray");
Char = reader.ReadChar("Char");
CharArray = reader.ReadCharArray("CharArray");
Short = reader.ReadShort("Short");
ShortArray = reader.ReadShortArray("ShortArray");
Int = reader.ReadInt("Int");
IntArray = reader.ReadIntArray("IntArray");
Long = reader.ReadLong("Long");
LongArray = reader.ReadLongArray("LongArray");
Boolean = reader.ReadBoolean("Boolean");
BooleanArray = reader.ReadBooleanArray("BooleanArray");
Float = reader.ReadFloat("Float");
FloatArray = reader.ReadFloatArray("FloatArray");
Double = reader.ReadDouble("Double");
DoubleArray = reader.ReadDoubleArray("DoubleArray");
Decimal = reader.ReadDecimal("Decimal");
DecimalArray = reader.ReadDecimalArray("DecimalArray");
Date = reader.ReadTimestamp("Date");
DateArray = reader.ReadTimestampArray("DateArray");
String = reader.ReadString("String");
StringArray = reader.ReadStringArray("StringArray");
Guid = reader.ReadObject<Guid>("Guid");
GuidArray = reader.ReadGuidArray("GuidArray");
}
开发者ID:RazmikMkrtchyan,项目名称:ignite,代码行数:28,代码来源:TestModel.cs
示例4: ReadHeader
static bool ReadHeader(IBinaryReader reader, out ushort flags, out uint codeSize) {
byte b = reader.ReadByte();
switch (b & 7) {
case 2:
case 6:
flags = 2;
codeSize = (uint)(b >> 2);
return true;
case 3:
flags = (ushort)((reader.ReadByte() << 8) | b);
uint headerSize = (byte)(flags >> 12);
ushort maxStack = reader.ReadUInt16();
codeSize = reader.ReadUInt32();
uint localVarSigTok = reader.ReadUInt32();
reader.Position += -12 + headerSize * 4;
if (headerSize < 3)
flags &= 0xFFF7;
return true;
default:
flags = 0;
codeSize = 0;
return false;
}
}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:27,代码来源:InstructionUtils.cs
示例5: Deserialize
internal void Deserialize(IBinaryReader reader, int count)
{
for (int i = 0; i < count; i++)
{
_excerpts.Add(reader.ReadString());
}
}
开发者ID:ltbam,项目名称:Sphinx.Client,代码行数:7,代码来源:BuildExcerptsCommandResult.cs
示例6: BinaryPropertyDeserializer
///<summary>
///</summary>
///<param name = "reader"></param>
public BinaryPropertyDeserializer(IBinaryReader reader)
{
if (reader == null) {
throw new ArgumentNullException("reader");
}
_reader = reader;
}
开发者ID:jerkka,项目名称:Olan,代码行数:10,代码来源:BinaryPropertyDeserializer.cs
示例7: 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>();
}
开发者ID:RazmikMkrtchyan,项目名称:ignite,代码行数:11,代码来源:ComputeFuncJob.cs
示例8: 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();
}
开发者ID:dheep-purdessy,项目名称:ignite,代码行数:11,代码来源:ContinuousQueryFilterHolder.cs
示例9: Deserialize
internal void Deserialize(IBinaryReader reader, MatchParseContext context)
{
_docId = (context.LongIdentifiers) ? reader.ReadInt64() : reader.ReadInt32();
_weight = reader.ReadInt32();
AttributesValues.Deserialize(reader, context);
}
开发者ID:vpuhoff,项目名称:sphinx-dotnet-client,代码行数:7,代码来源:Match.cs
示例10: ParseMethodBody
public static MethodBodyHeader ParseMethodBody(IBinaryReader reader, out byte[] code, out byte[] extraSections) {
try {
return ParseMethodBody2(reader, out code, out extraSections);
}
catch (IOException) {
throw new InvalidMethodBody();
}
}
开发者ID:GreenDamTan,项目名称:de4dot,代码行数:8,代码来源:MethodBodyParser.cs
示例11: OperationDataMapper
public OperationDataMapper(IXmlReader xmlReader, IBinaryReader binaryReader, ISpatialRecordMapper spatialRecordMapper, ISectionMapper sectionMapper, IUniqueIdMapper uniqueIdMapper)
{
_spatialRecordMapper = spatialRecordMapper;
_sectionMapper = sectionMapper;
_uniqueIdMapper = uniqueIdMapper;
_xmlReader = xmlReader;
_binaryReader = binaryReader;
}
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:8,代码来源:OperationDataMapper.cs
示例12: Read
/// <summary>
/// Reads the column
/// </summary>
/// <param name="reader">A reader positioned on this column</param>
/// <returns>The column value</returns>
public uint Read(IBinaryReader reader) {
switch (size) {
case 1: return reader.ReadByte();
case 2: return reader.ReadUInt16();
case 4: return reader.ReadUInt32();
default: throw new InvalidOperationException("Invalid column size");
}
}
开发者ID:xingkongtianyu,项目名称:Protect.NET,代码行数:13,代码来源:ColumnInfo.cs
示例13: Deserialize
internal void Deserialize(IBinaryReader reader)
{
FlushTag = reader.ReadInt32();
if (FlushTag < 0)
{
throw new SphinxException(String.Format(Messages.Exception_CouldNotFlushIndexAttributeValues, FlushTag));
}
}
开发者ID:vpuhoff,项目名称:sphinx-dotnet-client,代码行数:8,代码来源:FlushAttributesCommandResult.cs
示例14: 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);
}
开发者ID:dheep-purdessy,项目名称:ignite,代码行数:12,代码来源:SerializableObjectHolder.cs
示例15: ResourceReader
ResourceReader(ModuleDef module, IBinaryReader reader, CreateResourceDataDelegate createResourceDataDelegate) {
this.reader = reader;
this.resourceDataCreator = new ResourceDataCreator(module);
this.createResourceDataDelegate = createResourceDataDelegate;
var stream = reader as IImageStream;
this.baseFileOffset = stream == null ? 0 : (long)stream.FileOffset;
}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:8,代码来源:ResourceReader.cs
示例16: readUInt32
static uint readUInt32(IBinaryReader reader)
{
try {
return reader.Read7BitEncodedUInt32();
}
catch {
throw new ResourceReaderException("Invalid encoded int32");
}
}
开发者ID:n017,项目名称:ConfuserDeobfuscator,代码行数:9,代码来源:ResourceReader.cs
示例17: ReadBinary
/// <summary>
/// Read binary object.
/// </summary>
/// <param name="obj">Instantiated empty object.</param>
/// <param name="reader">Reader.</param>
/// <exception cref="BinaryObjectException">Type is not registered in serializer: + type.Name</exception>
public void ReadBinary(object obj, IBinaryReader reader)
{
var binarizable = obj as IBinarizable;
if (binarizable != null)
binarizable.ReadBinary(reader);
else
GetDescriptor(obj).Read(obj, reader);
}
开发者ID:ArtemShutak,项目名称:ignite,代码行数:15,代码来源:BinaryReflectiveSerializer.cs
示例18: Deserialize
internal void Deserialize(IBinaryReader reader, int count)
{
for (int i = 0; i < count; i++)
{
SearchQueryResult result = new SearchQueryResult();
result.Deserialize(reader);
_queryResults.Add(result);
}
}
开发者ID:vpuhoff,项目名称:sphinx-dotnet-client,代码行数:9,代码来源:SearchCommandResult.cs
示例19: readExtraSections
public static byte[] readExtraSections(IBinaryReader reader)
{
try {
return readExtraSections2(reader);
}
catch (IOException) {
throw new InvalidMethodBody();
}
}
开发者ID:GodLesZ,项目名称:ConfuserDeobfuscator,代码行数:9,代码来源:MethodBodyParser.cs
示例20: CustomAttributeReader
CustomAttributeReader(ModuleDef module, IBinaryReader reader, bool ownRerader)
{
this.module = module;
this.reader = reader;
this.ownReader = ownRerader;
this.genericArguments = null;
this.recursionCounter = new RecursionCounter();
this.verifyReadAllBytes = false;
}
开发者ID:visi,项目名称:dnlib,代码行数:9,代码来源:CustomAttributeReader.cs
注:本文中的IBinaryReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论